Skip to main content

Convert a Uint8Array to a DataView

还没翻译译自英文(bun.com)本页 3 段都还没译

A Uint8Array is a typed array, a view over data in an underlying ArrayBuffer. To convert it to a DataView, create one over the same range of data.

const arr: Uint8Array = ...
const dv = new DataView(arr.buffer, arr.byteOffset, arr.byteLength);

See Binary Data.

翻訳 © 2026 fanyi.dev · 原文 © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)