Tauri readBinaryFile
readBinaryFile(: , :FsOptions
):Promise
<Uint8Array
filePath
string
options?
>
以字节数组的形式读取文件。
例
import { readBinaryFile, BaseDirectory } from '@tauri-apps/api/fs';
// Read the image file in the `$RESOURCEDIR/avatar.png` path
const contents = await readBinaryFile('avatar.png', { dir: BaseDirectory.Resource });
Since: 1.0.0
参数
名字 | 类型 |
---|---|
filePath | string |
options | FsOptions |
Returns: Promise<Uint8Array>