demo · v143
Blob.bytes()
Type some text or pick a file. The page calls both blob.bytes() and new Uint8Array(await blob.arrayBuffer()) on the same blob and shows the result and the timing for each.
input
or pick a file (read up to 4 MB shown)
blob.bytes()
—
arrayBuffer() round-trip
—
the call
// v143: a direct Uint8Array, no ArrayBuffer hop
const u8 = await blob.bytes();
// Equivalent to (and what people wrote before):
const u8old = new Uint8Array(await blob.arrayBuffer());
see also
- FileAPI: Blob.bytes() — feature index
- ChromeStatus entry
- FileAPI spec