Extensions for java.nio.channels.WritableByteChannel

write

fun WritableByteChannel.write(buffer: IoBuffer): Int

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