---
title: Convert a ReadableStream to an ArrayBuffer
description: "Read the entire contents of a `ReadableStream` into an `ArrayBuffer` with `Bun.readableStreamToArrayBuffer()`."
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#bunreadablestreamto).
