List of utility methods to do ByteBuffer Copy
ByteBuffer | copyByteBuffer(ByteBuffer paramByteBuffer) copy Byte Buffer ByteBuffer localByteBuffer = newByteBuffer(paramByteBuffer
.remaining());
paramByteBuffer.mark();
localByteBuffer.put(paramByteBuffer);
paramByteBuffer.reset();
localByteBuffer.rewind();
return localByteBuffer;
|
ByteBuffer | clone(ByteBuffer original) clone ByteBuffer clone = ByteBuffer.allocate(original.capacity());
original.rewind();
clone.put(original);
original.rewind();
clone.flip();
return clone;
|
void | copyFromBufferToBuffer(ByteBuffer out, ByteBuffer in, int sourceOffset, int length) Copy from one buffer to another from given offset if (in.hasArray() && out.hasArray()) { System.arraycopy(in.array(), sourceOffset + in.arrayOffset(), out.array(), out.position() + out.arrayOffset(), length); skip(out, length); } else { for (int i = 0; i < length; ++i) { out.put(in.get(sourceOffset + i)); |