io.vertx.core.streams

## Interface ReadStream<T>

- All Superinterfaces:
    StreamBase
  All Known Subinterfaces:
    AsyncFile, DatagramSocket, HttpClientRequest, HttpClientResponse, HttpServerFileUpload, HttpServerRequest, HttpServerRequestStream, MessageConsumer<T>, NetSocket, NetSocketStream, ServerWebSocket, ServerWebSocketStream, SockJSSocket, TestSuiteReport, TimeoutStream, WebSocket, WebSocketBase, WebSocketStream

      public interface ReadStream<T>
      extends StreamBase

  Represents a stream of items 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`.

  Author:
    Tim Fox

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ReadStream<T>` | `endHandler(Handler<Void> endHandler)` Set an end handler.
    `ReadStream<T>` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the read stream.
    `ReadStream<T>` | `handler(Handler<T> handler)` Set a data handler.
    `ReadStream<T>` | `pause()` Pause the `ReadSupport`.
    `ReadStream<T>` | `resume()` Resume reading.

- - ### Method Detail

    - #### exceptionHandler

          ReadStream<T> exceptionHandler(Handler<Throwable> handler)

      Set an exception handler on the read stream.
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### handler

          ReadStream<T> handler(Handler<T> handler)

      Set a data handler. As data is read, the handler will be called with the data.
      Returns:
        a reference to this, so the API can be used fluently

    - #### pause

          ReadStream<T> pause()

      Pause the `ReadSupport`. While it's paused, no data will be sent to the `dataHandler`
      Returns:
        a reference to this, so the API can be used fluently

    - #### resume

          ReadStream<T> resume()

      Resume reading. If the `ReadSupport` has been paused, reading will recommence on it.
      Returns:
        a reference to this, so the API can be used fluently

    - #### endHandler

          ReadStream<T> endHandler(Handler<Void> endHandler)

      Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
      Returns:
        a reference to this, so the API can be used fluently

Copyright © 2016. All rights reserved.