whatwg/streams

read all bytes: Why only Uint8Array instead of general BufferSource?

saschanaz opened this issue · 0 comments

What is the issue with the Streams Standard?

I just found that the chunk steps of read all bytes requires Uint8Array:

chunk steps, given chunk

  1. If chunk is not a Uint8Array object, call failureSteps with a TypeError and abort these steps.

Maybe it can be BufferSource instead?

(Context: Given this algorithm is implemented in Gecko as a pipe to internal output stream, I was investigating whether the code for WebTransport write could be reused here. WT accepts BufferSource which makes more sense to me.)