dom / latest / readablebytestreamcontroller.html /

ReadableByteStreamController

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

The ReadableByteStreamController interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Byte stream controllers are for byte streams.

Constructor

None. ReadableByteStreamController instances are created automatically during ReadableStream construction.

Properties

ReadableByteStreamController.byobRequest Read only

Returns the current BYOB pull request.

ReadableByteStreamController.desiredSize Read only

Returns the desired size required to fill the stream's internal queue.

Methods

ReadableByteStreamController.close()

Closes the associated stream.

ReadableByteStreamController.enqueue()

Enqueues a given chunk in the associated stream.

ReadableByteStreamController.error()

Causes any future interactions with the associated stream to error.

Examples

TBD.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
ReadableByteStreamController
89
89
99
No
75
No
89
89
No
63
No
15.0
byobRequest
89
89
99
No
75
No
89
89
No
63
No
15.0
close
89
89
99
No
75
No
89
89
No
63
No
15.0
desiredSize
89
89
99
No
75
No
89
89
No
63
No
15.0
enqueue
89
89
99
No
75
No
89
89
No
63
No
15.0
error
89
89
99
No
75
No
89
89
No
63
No
15.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController