> ## Documentation Index
> Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 将 Blob 转换为 Uint8Array

[`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) 类提供了多种方法来以不同格式读取其内容。此代码片段将内容读取为 `ArrayBuffer`，然后从该缓冲区创建一个 `Uint8Array`。

```ts theme={"theme":{"light":"github-light","dark":"dracula"}}
const blob = new Blob(["hello world"]);
const arr = new Uint8Array(await blob.arrayBuffer());
```

***

完整的二进制数据操作文档，请参见 [文档 > API > 二进制数据](/runtime/binary-data#conversion)。
