The ReadableStreamDefaultReader
interface of the Streams API represents a default reader that can be used to read stream data supplied from a network (such as a fetch request).
A ReadableStreamDefaultReader
can be used to read from a ReadableStream
that has an underlying source of any type (unlike a ReadableStreamBYOBReader
, which can only be used with readable streams that have an underlying byte source).
Note however that zero-copy transfer from an underlying source is only supported for underlying byte sources that autoallocate buffers. In other words, the stream must have been constructed specifying both type="bytes"
and autoAllocateChunkSize
. For any other underlying source, the stream will always satisfy read requests with data from internal queues.