readList method Null safety

List<int> readList(
  1. int numberOfBytes
)

Returns a list of the given numberOfBytes, read from the buffer.

Implementation

List<int> readList(int numberOfBytes) {
  List<int> list = data.sublist(_readPos, _readPos + numberOfBytes);
  _readPos += numberOfBytes;
  return list;
}