readZeroes method

void readZeroes(
  1. int length
)

Reads N bytes and verifies that every one is zero.

Implementation

void readZeroes(int length) {
  final start = index;
  while (length > 0) {
    final value = readUint8();
    if (value != 0) {
      throw _newException(
          "expected $length zero bytes found a non-zero byte after ${index - 1 - start} bytes",
          index: start);
    }
  }
}