vertx / io.vertx.reactivex.core.streams / ReadStream

# ReadStream

`interface ReadStream<T : Any> : StreamBase`

Represents a stream of items that can be read from.

Any class that implements this interface can be used by a io.vertx.reactivex.core.streams.Pump to pump data from it to a io.vertx.reactivex.core.streams.WriteStream.

NOTE: This class has been automatically generated from the io.vertx.core.streams.ReadStream non RX-ified interface using Vert.x codegen.

### Functions

endHandler | `abstract fun endHandler(endHandler: Handler<Void>): ReadStream<T>` Set an end handler. Once the stream has ended, and there is no more data to be read, this handler will be called.
exceptionHandler | `abstract fun exceptionHandler(handler: Handler<Throwable>): ReadStream<T>` Set an exception handler on the read stream.
getDelegate | `abstract fun getDelegate(): ReadStream<Any>`
handler | `abstract fun handler(handler: Handler<T>): ReadStream<T>` Set a data handler. As data is read, the handler will be called with the data.
newInstance | `open static fun <T : Any> newInstance(arg: ReadStream<Any>): ReadStream<T>` `open static fun <T : Any> newInstance(arg: ReadStream<Any>, __typeArg_T: TypeArg<T>): ReadStream<T>`
pause | `abstract fun pause(): ReadStream<T>` Pause the `ReadSupport`. While it's paused, no data will be sent to the `dataHandler`
resume | `abstract fun resume(): ReadStream<T>` Resume reading. If the `ReadSupport` has been paused, reading will recommence on it.
toFlowable | `abstract fun toFlowable(): Flowable<T>`
toObservable | `abstract fun toObservable(): Observable<T>`

### Inheritors

AsyncFile | `open class AsyncFile : ReadStream<Buffer>, WriteStream<Buffer>` Represents a file on the file-system which can be read from, or written to asynchronously. This class also implements io.vertx.reactivex.core.streams.ReadStream and io.vertx.reactivex.core.streams.WriteStream. This allows the data to be pumped to and from other streams, e.g. an io.vertx.reactivex.core.http.HttpClientRequest instance, using the io.vertx.reactivex.core.streams.Pump class NOTE: This class has been automatically generated from the io.vertx.core.file.AsyncFile non RX-ified interface using Vert.x codegen.
DatagramSocket | `open class DatagramSocket : ReadStream<DatagramPacket>, Measured` A datagram socket can be used to send io.vertx.reactivex.core.datagram.DatagramPacket's to remote datagram servers and receive io.vertx.reactivex.core.datagram.DatagramPackets . Usually you use a datagram socket to send UDP over the wire. UDP is connection-less which means you are not connected to the remote peer in a persistent way. Because of this you have to supply the address and port of the remote peer when sending data. You can send data to ipv4 or ipv6 addresses, which also include multicast addresses. Please consult the documentation for more information on datagram sockets. NOTE: This class has been automatically generated from the io.vertx.core.datagram.DatagramSocket non RX-ified interface using Vert.x codegen.
HttpClientRequest | `open class HttpClientRequest : WriteStream<Buffer>, ReadStream<HttpClientResponse>` Represents a client-side HTTP request. Instances are created by an io.vertx.reactivex.core.http.HttpClient instance, via one of the methods corresponding to the specific HTTP methods, or the generic request methods. On creation the request will not have been written to the wire. Once a request has been obtained, headers can be set on it, and data can be written to its body if required. Once you are ready to send the request, one of the `io.vertx.reactivex.core.http.HttpClientRequest#end` methods should be called. Nothing is actually sent until the request has been internally assigned an HTTP connection. The io.vertx.reactivex.core.http.HttpClient instance will return an instance of this class immediately, even if there are no HTTP connections available in the pool. Any requests sent before a connection is assigned will be queued internally and actually sent when an HTTP connection becomes available from the pool. The headers of the request are queued for writing either when the `io.vertx.reactivex.core.http.HttpClientRequest#end` method is called, or, when the first part of the body is written, whichever occurs first. This class supports both chunked and non-chunked HTTP. It implements io.vertx.reactivex.core.streams.WriteStream so it can be used with io.vertx.reactivex.core.streams.Pump to pump data with flow control. An example of using this class is as follows: NOTE: This class has been automatically generated from the io.vertx.core.http.HttpClientRequest non RX-ified interface using Vert.x codegen.
HttpClientResponse | `open class HttpClientResponse : ReadStream<Buffer>` Represents a client-side HTTP response. Vert.x provides you with one of these via the handler that was provided when creating the io.vertx.reactivex.core.http.HttpClientRequest or that was set on the io.vertx.reactivex.core.http.HttpClientRequest instance. It implements io.vertx.reactivex.core.streams.ReadStream so it can be used with io.vertx.reactivex.core.streams.Pump to pump data with flow control. NOTE: This class has been automatically generated from the io.vertx.core.http.HttpClientResponse non RX-ified interface using Vert.x codegen.
HttpServerFileUpload | `open class HttpServerFileUpload : ReadStream<Buffer>` Represents an file upload from an HTML FORM. NOTE: This class has been automatically generated from the io.vertx.core.http.HttpServerFileUpload non RX-ified interface using Vert.x codegen.
HttpServerRequest | `open class HttpServerRequest : ReadStream<Buffer>` Represents a server-side HTTP request. Instances are created for each request and passed to the user via a handler. Each instance of this class is associated with a corresponding io.vertx.reactivex.core.http.HttpServerResponse instance via `io.vertx.reactivex.core.http.HttpServerRequest#response`. It implements io.vertx.reactivex.core.streams.ReadStream so it can be used with io.vertx.reactivex.core.streams.Pump to pump data with flow control. NOTE: This class has been automatically generated from the io.vertx.core.http.HttpServerRequest non RX-ified interface using Vert.x codegen.
JsonParser | `open class JsonParser : ReadStream<JsonEvent>, Handler<Buffer>` A parser class which allows to incrementally parse json elements and emit json parse events instead of parsing a json element fully. This parser is convenient for parsing large json structures. The parser can also parse entire object or array when it is convenient, for instance a very large array of small objects can be parsed efficiently by handling array start/end and object events. Whenever the parser fails to parse or process the stream, the `io.vertx.reactivex.core.parsetools.JsonParser#exceptionHandler` is called with the cause of the failure and the current handling stops. After such event, the parser should not handle data anymore. NOTE: This class has been automatically generated from the io.vertx.core.parsetools.JsonParser non RX-ified interface using Vert.x codegen.
KafkaConsumer | `open class KafkaConsumer<K : Any, V : Any> : ReadStream<KafkaConsumerRecord<K, V>>` Vert.x Kafka consumer. You receive Kafka records by providing a `io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#handler`. As messages arrive the handler will be called with the records. The `io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#pause` and `io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#resume` provides global control over reading the records from the consumer. The `io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#pause` and `io.vertx.reactivex.kafka.client.consumer.KafkaConsumer#resume` provides finer grained control over reading records for specific Topic/Partition, these are Kafka's specific operations. NOTE: This class has been automatically generated from the io.vertx.kafka.client.consumer.KafkaConsumer non RX-ified interface using Vert.x codegen.
MessageConsumer | `open class MessageConsumer<T : Any> : ReadStream<Message<T>>` An event bus consumer object representing a stream of message to an io.vertx.reactivex.core.eventbus.EventBus address that can be read from. The `io.vertx.reactivex.core.eventbus.EventBus#consumer` or `io.vertx.reactivex.core.eventbus.EventBus#localConsumer` creates a new consumer, the returned consumer is not yet registered against the event bus. Registration is effective after the `io.vertx.reactivex.core.eventbus.MessageConsumer#handler` method is invoked. The consumer is unregistered from the event bus using the `io.vertx.reactivex.core.eventbus.MessageConsumer#unregister` method or by calling the `io.vertx.reactivex.core.eventbus.MessageConsumer#handler` with a null value.. NOTE: This class has been automatically generated from the io.vertx.core.eventbus.MessageConsumer non RX-ified interface using Vert.x codegen.
NetSocket | `open class NetSocket : ReadStream<Buffer>, WriteStream<Buffer>` Represents a socket-like interface to a TCP connection on either the client or the server side. Instances of this class are created on the client side by an io.vertx.reactivex.core.net.NetClient when a connection to a server is made, or on the server side by a io.vertx.reactivex.core.net.NetServer when a server accepts a connection. It implements both and so it can be used with io.vertx.reactivex.core.streams.Pump to pump data with flow control. NOTE: This class has been automatically generated from the io.vertx.core.net.NetSocket non RX-ified interface using Vert.x codegen.
RecordParser | `open class RecordParser : ReadStream<Buffer>, Handler<Buffer>` A helper class which allows you to easily parse protocols which are delimited by a sequence of bytes, or fixed size records. Instances of this class take as input io.vertx.reactivex.core.buffer.Buffer instances containing raw bytes, and output records. For example, if I had a simple ASCII text protocol delimited by '\n' and the input was the following:
     buffer1:HELLO\nHOW ARE Y buffer2:OU?\nI AM buffer3: DOING OK buffer4:\n
Then the output would be:
     buffer1:HELLO buffer2:HOW ARE YOU? buffer3:I AM DOING OK
Instances of this class can be changed between delimited mode and fixed size record mode on the fly as individual records are read, this allows you to parse protocols where, for example, the first 5 records might all be fixed size (of potentially different sizes), followed by some delimited records, followed by more fixed size records. Instances of this class can't currently be used for protocols where the text is encoded with something other than a 1-1 byte-char mapping. Please see the documentation for more information. NOTE: This class has been automatically generated from the io.vertx.core.parsetools.RecordParser non RX-ified interface using Vert.x codegen.
SQLRowStream | `open class SQLRowStream : ReadStream<JsonArray>` A ReadStream of Rows from the underlying RDBMS. This class follows the ReadStream semantics and will automatically close the underlying resources if all returned rows are returned. For cases where the results are ignored before the full processing of the returned rows is complete the close method **MUST** be called in order to release underlying resources. The interface is minimal in order to support all SQL clients not just JDBC. NOTE: This class has been automatically generated from the io.vertx.ext.sql.SQLRowStream non RX-ified interface using Vert.x codegen.
TestSuiteReport | `open class TestSuiteReport : ReadStream<TestCaseReport>` The test suite reports is basically a stream of events reporting the test suite execution. NOTE: This class has been automatically generated from the io.vertx.ext.unit.report.TestSuiteReport non RX-ified interface using Vert.x codegen.
TimeoutStream | `open class TimeoutStream : ReadStream<Long>` A timeout stream is triggered by a timer, the io.vertx.reactivex.core.Handler will be call when the timer is fired, it can be once or several times depending on the nature of the timer related to this stream. The will be called after the timer handler has been called. Pausing the timer inhibits the timer shots until the stream is resumed. Setting a null handler callback cancels the timer. NOTE: This class has been automatically generated from the io.vertx.core.TimeoutStream non RX-ified interface using Vert.x codegen.
WebSocketBase | `interface WebSocketBase : ReadStream<Buffer>, WriteStream<Buffer>` Base WebSocket implementation. It implements both and so it can be used with io.vertx.reactivex.core.streams.Pump to pump data with flow control. NOTE: This class has been automatically generated from the io.vertx.core.http.WebSocketBase non RX-ified interface using Vert.x codegen.