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

# 将 Uint8Array 转换为 DataView

[`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) 是一种\_类型化数组\_，是对底层 `ArrayBuffer` 中数据的视图。要将其转换为 `DataView`，可以在相同的数据范围内创建一个 `DataView`。

```ts theme={null}
const arr: Uint8Array = ...
const dv = new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
```

***

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