Here you can find the source of copyByteBuffer(ByteBuffer paramByteBuffer)
public static ByteBuffer copyByteBuffer(ByteBuffer paramByteBuffer)
//package com.java2s; import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { public static ByteBuffer copyByteBuffer(ByteBuffer paramByteBuffer) { ByteBuffer localByteBuffer = newByteBuffer(paramByteBuffer .remaining());/*from w w w. j a v a 2s . com*/ paramByteBuffer.mark(); localByteBuffer.put(paramByteBuffer); paramByteBuffer.reset(); localByteBuffer.rewind(); return localByteBuffer; } public static ByteBuffer newByteBuffer(int paramInt) { ByteBuffer localByteBuffer = ByteBuffer.allocateDirect(paramInt); localByteBuffer.order(ByteOrder.nativeOrder()); return localByteBuffer; } }