writeBytes method Null safety

  1. @override
void writeBytes(
  1. List<int> bytes,
  2. [int? len]
)
override

Write a set of bytes to the end of the buffer.

Implementation

@override
void writeBytes(List<int> bytes, [int? len]) {
  len ??= bytes.length;

  while (length + len > _buffer.length) {
    _expandBuffer((length + len) - _buffer.length);
  }
  _buffer.setRange(length, length + len, bytes);
  length += len;
}