Here you can find the source of writeBuffer(ByteBuffer dest, ByteBuffer src)
public static void writeBuffer(ByteBuffer dest, ByteBuffer src)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static void writeBuffer(ByteBuffer dest, ByteBuffer src) { int position = src.position(); dest.put(src);/*from w w w. j a v a2 s .c o m*/ src.position(position); } }