readAt method

  1. @override
Future<Uint8List> readAt(
  1. int offset,
  2. int count
)
override

Reads on the main thread through Blob.slice().arrayBuffer(). A lane does not call it for this source; it is for reading the source yourself.

Implementation

@override
Future<Uint8List> readAt(int offset, int count) async {
  final start = offset.clamp(0, length);
  final end = (offset + count).clamp(start, length);
  final buffer = await blob.slice(start, end).arrayBuffer().toDart;
  return buffer.toDart.asUint8List();
}