简体   繁体   English

从 ReadableStream 读取所有字节

[英]Read all bytes from a ReadableStream

I'd like to load an entire fetch response in one go, but there doesn't seem to be a readAll or similar function.我想一次性加载整个获取响应,但似乎没有readAll或类似功能。

What is the most performant way to read every byte from a ReadableStreamDefaultReader into a single Uint8Array ?ReadableStreamDefaultReader中的每个字节读取到单个Uint8Array中的最有效方法是什么?

Fetch's Response interface has .arrayBuffer() which returns an ArrayBuffer . Fetch 的Response接口有.arrayBuffer()返回一个ArrayBuffer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何限制从 ReadableStream 中每次读取的大小 - How to limit the size of each read from a ReadableStream 无法从 aws lambda (java) 读取 json 正文响应。 它说可读流 - Not able to read the json body response from aws lambda (java). It says ReadableStream 如何通过API调用(Node.js)从ReadableStream中读取和下载文件? - How can I read and download a file from a ReadableStream on an API call (Node.js)? 从浏览器中的网络摄像头获取 ReadableStream - Get ReadableStream from Webcam in Browser 从 ReadableStream 对象中检索数据? - Retrieve data from a ReadableStream object? 如何从 ReadableStream 响应访问数据? - How to access data from ReadableStream response? NodeList.forEach中的appendChild只追加来自readableStream的第一个元素 - appendChild in NodeList.forEach only appends the first element from readableStream 如何在已经从fetch返回的浏览器上下载ReadableStream - How to download a ReadableStream on the browser that has been returned from fetch 处理来自 API cat-facts 的 ReadableStream 响应 - Dealing with ReadableStream response from API cat-facts 从中间件返回文件数据时,为什么 ReadableStream 比 Buffer 更可取? - Why is ReadableStream preferable to Buffer when returning file data from a middleware?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM