Converts a ReadableStream of Uint8Array chunks to a single Uint8Array.
ReadableStream
Uint8Array
Delegates to the given strategy so callers can trade runtime against memory footprint. Defaults to stream2uint8arrayGrowResizable when the runtime supports resizable ArrayBuffers, otherwise to stream2uint8arrayChunkAndJoin.
ArrayBuffer
Optional
The stream to consume (returns an empty array if undefined)
Implementation used to consume the stream
Promise resolving to the concatenated bytes
const bytes = await stream2uint8array(response.body);// Cap the resizable buffer explicitlyconst capped = await stream2uint8array(response.body, fnStream2uint8arrayGrowResizable(8 * 1024 * 1024)); Copy
const bytes = await stream2uint8array(response.body);// Cap the resizable buffer explicitlyconst capped = await stream2uint8array(response.body, fnStream2uint8arrayGrowResizable(8 * 1024 * 1024));
Converts a
ReadableStreamofUint8Arraychunks to a singleUint8Array.Delegates to the given strategy so callers can trade runtime against memory footprint. Defaults to stream2uint8arrayGrowResizable when the runtime supports resizable
ArrayBuffers, otherwise to stream2uint8arrayChunkAndJoin.