Re: [streams] Support reading bytes into buffers allocated by user code on platforms where only async read is available (#253)

> OK but need to return the detached ArrayBuffer. The empty view holds the detached ArrayBuffer.

Oh, I see. That is bad. That means code cannot always assume EOS is the way to detect end of stream.

I guess it still works if we say that read(undefined) uses EOS and read(view) uses an empty view. Because the consumer knows which version they used and so they can write the appropriate code to check. But it's annoying.

Maybe we should do { value, done } instead. Then it can be the same.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/253#issuecomment-77456956

Received on Thursday, 5 March 2015 21:35:35 UTC