readFileStream method
Implementation
@override
Future<Stream<Uint8List>> readFileStream(String uri,
{int? bufferSize, int? start}) async {
var session = _nextSession();
var channelName =
await methodChannel.invokeMethod<String>('readFileStream', {
'fileUri': uri.toString(),
'session': session.toString(),
'bufferSize': bufferSize,
'start': start,
});
if (channelName == null) {
throw Exception('Unexpected empty channel name from `readFile`');
}
var stream = EventChannel(channelName);
return stream.receiveBroadcastStream().map((e) => e as Uint8List);
}