admin管理员组文章数量:1357273
I'd like to load an entire fetch response in one go, but there doesn't seem to be a readAll
or similar function.
What is the most performant way to read every byte from a ReadableStreamDefaultReader into a single Uint8Array?
I'd like to load an entire fetch response in one go, but there doesn't seem to be a readAll
or similar function.
What is the most performant way to read every byte from a ReadableStreamDefaultReader into a single Uint8Array?
Share Improve this question edited Apr 24, 2019 at 13:17 Marvin Irwin asked Apr 24, 2019 at 12:33 Marvin IrwinMarvin Irwin 1,0309 silver badges17 bronze badges 2-
1
would
response.arrayBuffer()
do what you need? – Daniel A. White Commented Apr 24, 2019 at 12:36 - Damn, I walked right by that one. Post that as the answer and I'll accept – Marvin Irwin Commented Apr 24, 2019 at 12:38
1 Answer
Reset to default 9Fetch's Response
interface has .arrayBuffer()
which returns an ArrayBuffer
.
本文标签: javascriptRead all bytes from a ReadableStreamStack Overflow
版权声明:本文标题:javascript - Read all bytes from a ReadableStream - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743986829a2571418.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论