writeZeroes method

void writeZeroes(
  1. int writtenLength
)

Writes N zeroes.

Implementation

void writeZeroes(int writtenLength) {
  ensureAvailableLength(writtenLength);
  final byteData = this._byteData;
  var bufferLength = this._length;
  while (writtenLength >= 4) {
    byteData.setUint32(bufferLength, 0);
    bufferLength += 4;
    writtenLength -= 4;
  }
  while (writtenLength > 0) {
    byteData.setUint8(bufferLength, 0);
    bufferLength++;
    writtenLength--;
  }
  this._length = bufferLength;
}