public static void empty ( WritableByteChannel out , ByteBuffer buffer ) throws IOException { while ( buffer . hasRemaining ( ) ) out . write ( buffer ) ; }
Empties the contents of the given buffer into the writable channel provided . The buffer will be copied to the channel in it s entirety .