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

> For the return type,
> ...
> I think Uint8Array is best here.

I understand all of your analysis here.

I prefer Uint8Array and Int8Array to the others (including Uint8Clamped). But yeah, it would be nice if we could also eliminate the implication of sign and byte-wise processing.

It looks beautiful if we had a new concrete type on which only stuffs defined on the ArrayBufferView interface are exposed. I like it, but it doesn't add any practical benefit. I feel that we shouldn't add more type just for purity. If no one has strong opinion, I'd go with Uint8Array to finish the bikeshed :)

As I think we want to allow passing the read data directly to someone expecting ArrayBufferView, returning a tuple is not an option.

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

Received on Thursday, 12 March 2015 07:55:12 UTC