write method
Write bytes into the buffer. Optional length
to write a specific number
of bytes
, otherwise the length from bytes
is used.
Implementation
void write(Uint8List bytes, [int? length]) {
length ??= bytes.length;
_ensureAvailable(length);
_buffer.setRange(_writeIndex, _writeIndex + length, bytes);
_writeIndex += length;
}