Skip to main content
Bun 提供了许多便利函数,用于将 ReadableStream 的内容读取为不同格式。
const stream = new ReadableStream();
const buf = await Bun.readableStreamToArrayBuffer(stream);

请参阅 文档 > API > 工具 了解 Bun 的其他 ReadableStream 转换函数的文档。