toUint8List method Null safety

  1. @override
Uint8List toUint8List()
override

Implementation

@override
Uint8List toUint8List() {
  if (isEOS) {
    return Uint8List(0);
  }
  var length = fileRemaining;
  final bytes = Uint8List(length);
  _file.position = _fileOffset + _position;
  final readBytes = _file.readInto(bytes);
  skip(length);
  if (readBytes != bytes.length) {
    bytes.length = readBytes;
  }
  return bytes;
}