The difference between non-blocking reads and blocking reads is obvious, but I am confused about writes. I understand that a non-blocking write never blocks (duh!). If the underlying socket buffer is full, bytes are simply not written to it. That's why it is important to check how many bytes were written when you call channel.write.
Now how about blocking writes? When does it block? When you call flush? When you call write on its OutputStream? Does it block until there is space in the underlying write socket buffer? Or does it throw an exception if it cannot write?