readPacket

suspend fun ByteReadChannel.readPacket(packet: Int): Source

Reads a packet of packet bytes from the channel.

Throws

EOFException

if the channel is closed before the packet is fully read.