readTo
Reads bytes from this ByteReadChannel and writes them to the specified sink. If an exception is thrown, the channel and sink are closed.
Return
the number of bytes transferred
Parameters
sink
the destination to write bytes to
limit
the maximum number of bytes to transfer, defaults to Long.MAX_VALUE
Throws
if the channel is closed with an error