Extensions for java.nio.channels.ReadableByteChannel
fun ReadableByteChannel.asInput( |
|
fun ReadableByteChannel. Does the same as ReadableByteChannel.read but to a IoBuffer instance fun ReadableByteChannel. Does the same as ReadableByteChannel.read but to a Buffer instance fun ReadableByteChannel.read( Does the same as ReadableByteChannel.read but to a Memory instance |
|
fun ReadableByteChannel.readPacketAtLeast( Read a packet of at least n bytes or all remaining. Does fail if not enough bytes remaining. . This function is useless with non-blocking channels |
|
fun ReadableByteChannel.readPacketAtMost( Read a packet of at most n bytes. Resulting packet could be empty however this function does always reads as much bytes as possible. You also can use it with non-blocking channels |
|
fun ReadableByteChannel.readPacketExact( Read a packet of exactly n bytes. This function is useless with non-blocking channels |