Re: [streams] What types does ReadableByteStream's reader's read(x) accept and return? (#295)

> What is the motivation for having pull() at all, instead of just using pullInto()? I imagine there is one and I just forgot it. Let's be sure to write it down, either in FAQ.md or in the spec or something?

`pullInto(buffer, offset, length)` passes the buffer given by the consumer while `pull()` just tells that a non-BYOB reader attached received a `.read()` call. In this (`.read()`) case, there's no buffer to pass to the underlying byte source.

Create https://github.com/whatwg/streams/issues/363 for reminder.

> These sound pretty great. So to be clear, pullInto() always gets a Uint8Array? I like that.

Yes. buffer, offset and length.

> This one is a big strange. I am not sure I understand the reasoning. Maybe instead we should just give the buffer back as a zero-length view?

Hmm, which point? We require the argument of `respond()` to be 0. The buffer returned by the `respond()` call is returned to the consumer with the byteLength set to 0, yes.

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

Received on Tuesday, 16 June 2015 05:01:22 UTC