readBytes method

Uint8List readBytes(
  1. int numBytes
)

Implementation

Uint8List readBytes(int numBytes) {
  if ((_offset! + numBytes) <= fileLength!) {
    int oldOffset = _offset!;
    _offset = numBytes + 1;
    pad();
    return Uint8List.fromList(
        data.getRange(oldOffset, oldOffset + numBytes).toList());
  } else
    throw RangeError("Reached end of file");
}