# Convert a ReadableStream to an ArrayBuffer

> Read the entire contents of a `ReadableStream` into an `ArrayBuffer` with `Bun.readableStreamToArrayBuffer()`.

`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](https://bun.aphrody.app/docs/runtime/utils#bunreadablestreamto).
