Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
Set an exception handler on the read stream.
Fetch the specified amount
of elements. If the ReadStream
has been paused, reading will
recommence with the specified amount
of items, otherwise the specified amount
will
be added to the current stream demand.
Set a data handler. As data is read, the handler will be called with the data.
Pause the ReadStream
, it sets the buffer in fetch
mode and clears the actual demand.
While it's paused, no data will be sent to the data handler
.
Pause this stream and return a Pipe to transfer the elements of this stream to a destination WriteStream.
The stream will be resumed when the pipe will be wired to aWriteStream
.
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Resume reading, and sets the buffer in flowing
mode.
ReadStream
has been paused, reading will recommence on it.
Generated using TypeDoc
Represents a stream of items that can be read from.
Any class that implements this interface can be used by a Pipe to pipe data from it to a WriteStream.
Streaming mode
The stream is either in flowing or fetch mode.Initially the stream is in flowing mode.- When the stream is in flowing mode, elements are delivered to the
- When the stream is in fetch mode, only the number of requested elements will be delivered to the
The mode can be changed with the {@link ReadStream#pause}, {@link ReadStream#resume} and {@link ReadStream#fetch} methods:handler
.handler
.0