Get to know MDN better
Since March 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Note: This feature is available in Web Workers.
The byobRequest read-only property of the ReadableByteStreamController interface returns the current BYOB request, or null if there are no pending requests.
An underlying byte source should check this property, and use it to write data to the stream if it exists (rather than using ReadableByteStreamController.enqueue()). This will result in an efficient zero-byte transfer of the data to the consumer.
A ReadableStreamBYOBRequest object instance, or null.
The example in Using readable byte streams > Creating a readable socket push byte stream shows how you use a byobRequest to transfer data (if it exists), or otherwise copy the data to the stream's internal queues using ReadableByteStreamController.enqueue().
The relevant code is reproduced below. If the byobRequest exists, data is read into controller.byobRequest.view, and then ReadableStreamBYOBRequest.respond() is called to signal the amount of data that is ready to transfer.
| Streams # ref-for-rbs-controller-byob-request② |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 22, 2024 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.