Extensions for java.nio.channels.ReadableByteChannel

read

fun ReadableByteChannel.read(buffer: IoBuffer): Int

Read from a NIO channel into the specified buffer Could return 0 if the channel is non-blocking or buffer has no free space