The streams APIs provide ubiquitous, interoperable primitives for creating, composing, and consuming streams of data. For streams representing bytes, an extended version of the readable stream is provided to handle bytes efficiently, in particular by minimizing copies.
Byte streams allow for BYOB readers to be acquired. The default implementation can give a range of different outputs such as strings or array buffers in the case of WebSockets, whereas byte streams guarantee byte output. Furthermore, being able to have BYOB readers has benefits in terms of stability. This is because if a buffer detaches, it can guarantee that one does not write into the same buffer twice, hence avoiding race conditions. BYOB readers also do not need to garbage collect for every read, because we can reuse buffers.
Final published standard: Recommendation, Living Standard, Candidate Recommendation, or similar final form
Status in Chromium
Enabled by default
Consensus & Standardization
Intent to Prototype urlIntent to Prototype thread
Last updated on 2022-01-14