readFileStream method
Implementation
@override
Future<Stream<Uint8List>> readFileStream(
String uri, {
int? bufferSize,
int? start,
}) async {
final session = _nextSession();
final 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`');
}
final stream = EventChannel(channelName);
return stream.receiveBroadcastStream().map((e) => e as Uint8List);
}