ReadableStream object

The ReadableStream object represents a source of data to be read from. It is adaptable to any chunk type, with a chunk being a single piece of data to be read from the stream. A queue exists to keep track of data from the source that hasn't been read yet.

Members

The ReadableStream object has these types of members:

  • Methods
  • Properties

Methods

The ReadableStream object has these methods.

Method Description
cancel

The cancel method signals that the reader no longer has need of the stream, thus throwing away any queued data.

getReader

The getReader method creates a stream reader and locks the stream to the new reader.

 

Properties

The ReadableStream object has these properties.

Property Access type Description

locked

Read-only

Determines whether the stream has been locked for reading.

 

Standards information

Remarks

A ReadableStream object can only be accessed by getting it from the body property of a Fetch Response object.

A ReadableStream object can only have one reader at a time.