Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.vertx.groovy.core.streams
[Groovy] Interface ReadStream

    interface ReadStream

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.

Authors:
  Tim Fox

Method Summary
`void` | `dataHandler(groovy.lang.Closure handler)` Set a data handler.
`void` | `endHandler(groovy.lang.Closure handler)` Set an end handler.
`void` | `exceptionHandler(groovy.lang.Closure handler)` Set an exception handler.
`void` | `pause()` Pause the `ReadStream`.
`void` | `resume()` Resume reading.

Method Detail

### dataHandler

    void dataHandler(groovy.lang.Closure handler)

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

### endHandler

    void endHandler(groovy.lang.Closure handler)

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

### exceptionHandler

    void exceptionHandler(groovy.lang.Closure handler)

  Set an exception handler.

### pause

    void pause()

  Pause the `ReadStream`. After calling this, the ReadStream will aim to send no more data to the `dataHandler`

### resume

    void resume()

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

Groovy Documentation