Skip to content
Workers
Visit Workers on GitHub
Set theme to dark (⇧+D)

ReadableStreamBYOBReader

Background

BYOB is an abbreviation of "bring your own buffer." A ReadableStreamBYOBReader allows reading into a developer-supplied buffer, thus minimizing copies.

An instance of ReadableStreamBYOBReader is functionally identical to ReadableStreamDefaultReader with the exception of the read method.

A ReadableStreamBYOBReader is not instantiated via its constructor. Rather, it is retrieved from a ReadableStream:

const { readable, writable } = new TransformStream()const reader = readable.getReader({ mode: "byob" })

Methods

Common issues

See also