Files

17 lines
480 B
Plaintext
Raw Permalink Normal View History

2026-08-27 21:09:14 +00:00
---
title: Convert a ReadableStream to an ArrayBuffer
sidebarTitle: Stream to ArrayBuffer
mode: center
---
`Bun.readableStreamToArrayBuffer` reads the contents of a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) into an `ArrayBuffer`.
```ts
const stream = new ReadableStream();
const buf = await Bun.readableStreamToArrayBuffer(stream);
```
---
See [Bun's other `ReadableStream` conversion functions](/runtime/utils#bun-readablestreamto).