readAsBytes method
Implementation
Future<List<int>> readAsBytes(final Uri uri) async {
final Uint8List? content = uri.data?.contentAsBytes();
if (content != null) {
return content;
}
switch (uri.scheme) {
case '':
case 'file':
return await readFileAsBytes(uri);
case 'http':
case 'https':
final http.Response response = await http.get(uri);
return response.bodyBytes;
}
throw Exception('Unknown uri scheme for $uri');
}