Skip to main content

Convert a Buffer to a Uint8Array

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

The Node.js Buffer class extends Uint8Array, so no conversion is needed. All properties and methods on Uint8Array are available on Buffer.

const buf = Buffer.alloc(64);
buf instanceof Uint8Array; // => true

See Binary Data.

번역 © 2026 fanyi.dev · 원문 © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)