vertx / io.vertx.reactivex.core.file / AsyncFile / read

# read

`open fun read(buffer: Buffer, offset: Int, position: Long, length: Int, handler: Handler<AsyncResult<Buffer>>): AsyncFile`

Reads `length` bytes of data from the file at position `position` in the file, asynchronously.

The read data will be written into the specified `Buffer buffer` at position `offset`.

If data is read past the end of the file then zero bytes will be read.

When multiple reads are invoked on the same file there are no guarantees as to order in which those reads actually occur.

The handler will be called when the close is complete, or if an error occurs.

### Parameters

`buffer` - the buffer to read into

`offset` - the offset into the buffer where the data will be read

`position` - the position in the file where to start reading

`length` - the number of bytes to read

`handler` - the handler to call when the write is complete

Return
a reference to this, so the API can be used fluently