read method
Implementation
int read(Uint8List buffer, int offset, int count) {
int bytesToRead = count;
if (_position + count > _data.length) {
bytesToRead = _data.length - _position;
}
if (bytesToRead <= 0) return 0;
buffer.setRange(
offset,
offset + bytesToRead,
_data.sublist(_position, _position + bytesToRead),
);
_position += bytesToRead;
return bytesToRead;
}