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

> just make the return type be the same type of view as gets passed in to the read(view) method!

Is the benefit of that approach that we explicitly pass the underlying buffer than passing the view implying that the whole buffer behind it is subject to detaching? Hmm, I understand. Unlike others such as XHR, the BYOD stream temporarily takes the ownership of the provided buffer. If we really set a high value on that point, we should rather stop accepting ArrayBufferViews directly, I guess. And, ... that's just inconvenient?

Maybe we could establish another view point for ArrayBufferView type arguments:
- an ArrayBufferView argument passes the ownership of the underlying buffer together with the target range using a single object for convenience.

In addition to the view point we already have, that is:
- an ArrayBufferView argument shows the contents of the underlying buffer of the specified region to the API.

> We should be able to avoid making this assumption (even though it will always be true, I think) by using the done part of the { value, done } tuple.

OK

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

Received on Thursday, 12 March 2015 12:37:43 UTC