readBytes method

  1. @override
Uint8List readBytes(
  1. int offset,
  2. int count
)
override

Implementation

@override
Uint8List readBytes(int offset, int count) {
  if (offset < 0 || count < 0 || offset + count > _length) {
    throw TiffException(
      'Attempted to read past the end of the file (offset=$offset, count=$count, length=$_length)',
    );
  }
  final windowEnd = _windowStart + _window.length;
  if (offset < _windowStart || offset + count > windowEnd) {
    _fillWindow(offset, count);
  }
  final localStart = offset - _windowStart;
  return Uint8List.sublistView(_window, localStart, localStart + count);
}