readTo

fun Buffer.readTo(sink: RawSink, kapacity: Kapacity)

Removes exactly the specified kapacity of bytes from this buffer and appends them to the sink.

Parameters

sink

The destination sink to write the bytes to.

kapacity

The exact amount of data to read.

Throws

EOFException

if the buffer is exhausted before the requested capacity is read.