readAsBytes static method
读取文件 - 以字节流的形式
Implementation
static Future<Uint8List> readAsBytes(String path) async {
// 增加通用处理 - 如果文件不存在则报错
if (await existsAsync(path)) {
return File(path).readAsBytes();
} else {
throw FileIOException('路径不存在: $path');
}
}