writeBlock16 method

int writeBlock16(
  1. Uint8List bs, [
  2. int offset = 0,
  3. int? length
])

Writes a blocks of data using a 16-bit integer as length prefix.

Implementation

int writeBlock16(Uint8List bs, [int offset = 0, int? length]) {
  length ??= bs.length - offset;

  final pos = position;
  bytesIO.ensureCapacity(pos + 2 + length);

  var sz = writeUint16(length);
  bytesIO.writeBytes(bs, offset, length);

  return sz + length;
}