> ## 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.

# 将 ArrayBuffer 转换为 Blob

一个 [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) 可以由一个“块”数组构造，其中每个块可以是字符串、二进制数据结构或另一个 `Blob`。

```ts theme={"theme":{"light":"github-light","dark":"dracula"}}
const buf = new ArrayBuffer(64);
const blob = new Blob([buf]);
```

***

默认情况下，生成的 `Blob` 的 `type` 属性是未设置的。可以手动设置它。

```ts theme={"theme":{"light":"github-light","dark":"dracula"}}
const buf = new ArrayBuffer(64);
const blob = new Blob([buf], { type: "application/octet-stream" });
blob.type; // => "application/octet-stream"
```

***

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