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

# 将 Buffer 转换为 Uint8Array

Node.js 的 [`Buffer`](https://nodejs.org/api/buffer.html) 类继承自 [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)，因此无需转换。`Uint8Array` 上的所有属性和方法在 `Buffer` 上都可用。

```ts theme={null}
const buf = Buffer.alloc(64);
buf instanceof Uint8Array; // => true
```

***

参见 [二进制数据](/runtime/binary-data#conversion)。
