readChunk method

Future<List<int>> readChunk(
  1. File file,
  2. int startOffset,
  3. int length
)

Implementation

Future<List<int>> readChunk(File file, int startOffset, int length) async {
  final raf = await file.open();
  await raf.setPosition(startOffset);
  final chunk = await raf.read(length);
  await raf.close();
  return chunk;
}