code: public static void writeCompletely(WritableByteChannel channel, ByteBuffer src) throws IOException {
  		while (src.hasRemaining()) {
  			channel.write(src);
  		}
  	}
docs: ------------------------------------------------------------------------