Specify stream chunk type.
yutakahirano opened this issue · 4 comments
Requested at w3c/ServiceWorker#452 (comment) by @wanderview.
blocked by #17.
Thanks Yutaka!
Can we also specify how the size of the ArrayBuffer is determined? Is the UA free to chunk the data however it wishes? Or does it have to return all available data in a single chunk when read() is called?
Is the UA free to chunk the data however it wishes?
Yes.
By the way, I'm planning to use ReadableByteStream instead of ReadableStream when it gets stable enough (now it's not stable enough, so I will use ReadableStream for quite a while). It has readInto()
function and the user can specify the buffer size with it.
memo: I created a branch https://github.com/yutakahirano/fetch-with-streams/tree/use-arraybuffer-as-chunk for this issue. Its parent is https://github.com/yutakahirano/fetch-with-streams/tree/readable-stream-and-response which is a branch for #17.