Skip to main content

Convert an ArrayBuffer to a Blob

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

You can construct a Blob from an array of "chunks", where each chunk is a string, binary data structure, or another Blob.

const buf = new ArrayBuffer(64);
const blob = new Blob([buf]);

By default the type of the resulting Blob is unset. Set it with the type option.

const buf = new ArrayBuffer(64);
const blob = new Blob([buf], { type: "application/octet-stream" });
blob.type; // => "application/octet-stream"

See Binary Data.

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