readAsBytesSync static method

Uint8List readAsBytesSync(
  1. String path
)

读取文件 - 以字节流的形式

Implementation

static Uint8List readAsBytesSync(String path) {
  if (existsSync(path)) {
    return File(path).readAsBytesSync();
  } else {
    throw FileIOException('路径不存在: $path');
  }
}