I understand a channel.write(outBuffer) can fail to write all the contents of outBuffer because the underlying socket buffer is full. Then you have to register OP_WRITE and wait for selector callbacks. However I don't want to write a partial message and I would like to wait until the channel.write operation is capable of writing out my full message. Is that possible or I have to write to find out how much I can write?
Talking about a http://docs.oracle.com/javase/6/docs/api/java/nio/channels/WritableByteChannel.html of course.