Skip to main content

Convert a Uint8Array to a Buffer

The Buffer class extends Uint8Array with additional methods. Use Buffer.from() to create a Buffer instance from a Uint8Array.

const arr: Uint8Array = ...
const buf = Buffer.from(arr);

See Binary Data.

Translation © 2026 fanyi.dev · Original © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)