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

# 将 Uint8Array 转换为 Buffer

[`Buffer`](https://nodejs.org/api/buffer.html) 类扩展了 [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)，增加了许多附加方法。使用 `Buffer.from()` 可以从 `Uint8Array` 创建一个 `Buffer` 实例。

```ts theme={"theme":{"light":"github-light","dark":"dracula"}}
const arr: Uint8Array = ...
const buf = Buffer.from(arr);
```

***

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