readFileBytes method
Implementation
@override
Future<Uint8List> readFileBytes(String uri, {int? start, int? count}) async {
start ??= 0;
if (start < 0) {
throw ArgumentError('`start` must be greater than or equal to 0');
}
if (count != null) {
if (count <= 0) {
throw ArgumentError('`count` must be greater than 0');
}
}
final res = await methodChannel.invokeMethod<Uint8List>('readFileBytes', {
'fileUri': uri.toString(),
'start': start,
'count': count,
});
if (res == null) {
throw Exception('Unexpected empty response from `readFileBytes`');
}
return res;
}