Closed jasnell closed 2 months ago
I'm pretty firmly against this. Byte streams should be limited to streams of Uint8Arrays. Use a transform stream if you're getting the data in the wrong format. Then you can clearly choose the correct encoding, for example, instead of assuming UTF-8.
What problem are you trying to solve?
The
read all bytes
algorithm currently defined in the spec is currently limited toUint8Array
values:It would be helpful if this algorithm allowed for values with
stringifiers
to be used as well. Specifically, if the value has astringifier
then the value would be converted to a string then UTF-8 encoded for the purpose of theread all bytes
algorithm. This would allow, for instance, a stream of strings or various types of objects to be read:What solutions exist today?
No response
How would you solve it?
No response
Anything else?
No response