> ## Documentation Index
> Fetch the complete documentation index at: https://bun.ll1025.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 将 ReadableStream 转换为数据块数组

`Bun.readableStreamToArray` 读取 [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) 的内容到一个数据块数组中。

```ts theme={null}
const stream = new ReadableStream();
const str = await Bun.readableStreamToArray(stream);
```

***

参见 [Bun 的其他 `ReadableStream` 转换函数](/runtime/utils#bun-readablestreamto)。
