Represents a stream of data that can be read from.

Any class that implements this interface can be used by a Pump to pump data from it to a WriteStream.

By: Julien Viet

no subtypes hierarchy

Initializer
ReadStream(ReadStream<out Object> delegate)
Attributes
delegateshared ReadStream<out Object> delegate
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
dataHandlershared void dataHandler(void onData(Buffer buffer))

Set a data handler. As data is read, the handler will be called with the data.

endHandlershared void endHandler(void onEnd())

Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.

exceptionHandlershared void exceptionHandler(void onException(Throwable t))

Set an exception handler.

pauseshared void pause()

Pause the ReadStream. While the stream is paused, no data will be sent to the dataHandler

pumpshared Pump pump(WriteStream to, Integer? writeQueueMaxSize = null)

Create a new Pump with this ReadStream and the givenWriteStream and writeQueueMaxSize

Parameters:
  • writeQueueMaxSize = null
resumeshared void resume()

Resume reading. If the ReadStream has been paused, reading will recommence on it.

Inherited Methods
Methods inherited from: Object
equals