code: public static long copyChannel(WritableByteChannel dst, ReadableByteChannel src) throws IOException {
  		ByteBuffer buffer = ByteBuffer.allocateDirect(CHANNEL_IO_BUFFER_SIZE);
  		long copied = 0;
  		int read;
  
  		while ((read = src.read(buffer)) >= 0) {
  			buffer.flip();
  			dst.write(buffer);
  			buffer.clear();
  			copied += read;
  		}
  		return copied;
  	}
docs: Copies all bytes from a {@linkplain ReadableByteChannel} to a {@linkplain WritableByteChannel}.
  
  @param dst the {@linkplain WritableByteChannel} to copy to.
  @param src the {@linkplain ReadableByteChannel} to copy from.
  @return the number of copied bytes.
  @throws IOException if an I/O error occurs.