W3cubDocs

/DOM

ReadableStreamBYOBReader

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The ReadableStreamDefaultReader interface of the Streams API represents a BYOB ("bring your own buffer") reader that can be used to read stream data supplied by the developer (e.g. a custom ReadableStream.ReadableStream() constructor).

Constructor

ReadableStreamBYOBReader()
Creates and returns a ReadableStreamBYOBReader() object instance.

Properties

ReadableStreamBYOBReader.closed
Allows you to write code that responds to an end to the streaming process. Returns a promise that fulfills if the stream becomes closed or the reader's lock is released, or rejects if the stream errors.

Methods

ReadableStreamBYOBReader.cancel()
Cancels the stream, signaling a loss of interest in the stream by a consumer. The supplied reason argument will be given to the underlying source, which may or may not use it.
ReadableStreamBYOBReader.read()
Returns a promise providing access to the next chunk in the stream's internal queue.
ReadableStreamBYOBReader.releaseLock()
Releases the reader's lock on the stream.

Examples

TBD.

Specifications

Specification Status Comment
Streams
The definition of 'ReadableStreamBYOBReader' in that specification.
Living Standard Initial definition

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support No No No No No No
ReadableStreamBYOBReader() constructor No No No No No No
closed No No No No No No
cancel No No No No No No
read No No No No No No
releaseLock No No No No No No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support No No No No No No ?
ReadableStreamBYOBReader() constructor No No No No No No ?
closed No No No No No No ?
cancel No No No No No No ?
read No No No No No No ?
releaseLock No No No No No No ?

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader