ReadableStream extension type
The ReadableStream
interface of the
Streams API
represents a readable stream of byte data. The
Fetch API
offers a concrete instance of a ReadableStream
through the Response.body
property of a Response object.
ReadableStream
is a
transferable object.
API documentation sourced from MDN Web Docs.
- on
- Implemented types
- Available extensions
Constructors
- ReadableStream([JSObject underlyingSource, QueuingStrategy strategy])
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- locked → bool
-
The
locked
read-only property of the ReadableStream interface returns whether or not the readable stream is locked to a reader.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
[JSAny? reason]) → JSPromise< JSAny?> -
The
cancel()
method of the ReadableStream interface returns aPromise
that resolves when the stream is canceled. -
getReader(
[ReadableStreamGetReaderOptions options]) → ReadableStreamReader -
The
getReader()
method of the ReadableStream interface creates a reader and locks the stream to it. While the stream is locked, no other reader can be acquired until this one is released. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pipeThrough(
ReadableWritablePair transform, [StreamPipeOptions options]) → ReadableStream -
The
pipeThrough()
method of the ReadableStream interface provides a chainable way of piping the current stream through a transform stream or any other writable/readable pair. -
pipeTo(
WritableStream destination, [StreamPipeOptions options]) → JSPromise< JSAny?> -
The
pipeTo()
method of the ReadableStream interface pipes the currentReadableStream
to a given WritableStream and returns aPromise
that fulfills when the piping process completes successfully, or rejects if any errors were encountered. -
tee(
) → JSArray< ReadableStream> -
The
tee()
method of the ReadableStream interface tees the current readable stream, returning a two-element array containing the two resulting branches as new ReadableStream instances. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited