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