readFully

suspend fun ByteReadChannel.readFully(out: ByteArray, start: Int = 0, end: Int = out.size)

Reads bytes from start to end into the provided out buffer, or fails if the channel has been closed.

Suspension occurs when there are not enough bytes available in the channel.

Parameters

out

the buffer to write to

start

the index to start writing at

end

the index to write until

suspend fun <Error class: unknown class>.readFully(buffer: ByteBuffer)