readFileAsStream method

  1. @override
Stream<Uint8List> readFileAsStream(
  1. String filePath, {
  2. int chunkSize = 8192,
})
override

Reads a file in chunks and returns a stream of bytes chunkSize determines the size of each chunk (default 8KB)

Implementation

@override
Stream<Uint8List> readFileAsStream(String filePath, {int chunkSize = 8192}) {
  final file = File(filePath);
  return file.openRead().map((chunk) => Uint8List.fromList(chunk));
}