code: public static void empty( WritableByteChannel out, ByteBuffer buffer) throws IOException {
  		while ( buffer.hasRemaining()) out.write( buffer);
  	}
docs: Empties the contents of the given buffer into the
  writable channel provided. The buffer will be copied
  to the channel in it's entirety.
  
  @param out the channel to write to
  @param buffer the buffer to write out to the channel
  @throws IOException if an IO error occurs