List of utility methods to do ByteBuffer Clone
ByteBuffer | cloneOnHeap(final ByteBuffer buf) clone On Heap if (buf == null) { return null; buf.rewind(); final ByteBuffer copy = createByteBufferOnHeap(buf.limit()); copy.put(buf); return copy; |
ByteBuffer | cloneSection(ByteBuffer source, int start, int count) clone Section int oldPosition = source.position(); source.position(start); ByteBuffer result = source.slice(); result.order(source.order()); result.limit(count); source.position(oldPosition); return result; |