nextPutAll method

int nextPutAll(
  1. List<int> bytes, [
  2. int? start,
  3. int? end
])

Put bytes into the buffer.

The range from start to end must be a valid range of bytes. If start is omitted, it defaults to zero. If end is omitted, it defaults to the length of bytes.

The number of bytes put may be additionally constrained by the remaining unwrittenCount.

Return the number of bytes from bytes put into the buffer.

Implementation

int nextPutAll(List<int> bytes, [int? start, int? end]) {
  start ??= 0;
  end = RangeError.checkValidRange(start, end, bytes.length);
  final putAmount = min(end - start, unwrittenCount);
  final destination = writeListView(putAmount);
  destination.setRange(0, putAmount, bytes, start);
  incrementBytesWritten(putAmount);
  return putAmount;
}