question: public static final void copy ( final Memory source , final long srcOffsetBytes , final Memory destination , final long dstOffsetBytes , final long lengthBytes ) { assertBounds ( srcOffsetBytes , lengthBytes , source . getCapacity ( ) ) ; assertBounds ( dstOffsetBytes , lengthBytes , destination . getCapacity ( ) ) ; if ( destination . isReadOnly ( ) ) { throw new ReadOnlyMemoryException ( ) ; } long srcAdd = source . getCumulativeOffset ( srcOffsetBytes ) ; long dstAdd = destination . getCumulativeOffset ( dstOffsetBytes ) ; Object srcParent = ( source . isDirect ( ) ) ? null : source . getNativeMemory ( ) . memArray_ ; Object dstParent = ( destination . isDirect ( ) ) ? null : destination . getNativeMemory ( ) . memArray_ ; long lenBytes = lengthBytes ; while ( lenBytes > 0 ) { long chunkBytes = ( lenBytes > UNSAFE_COPY_THRESHOLD ) ? UNSAFE_COPY_THRESHOLD : lenBytes ; unsafe . copyMemory ( srcParent , srcAdd , dstParent , dstAdd , lenBytes ) ; lenBytes -= chunkBytes ; srcAdd += chunkBytes ; dstAdd += chunkBytes ; } }
target:  Copies bytes from a source Memory to the destination Memory.  If the source and destination are the same Memory use the single Memory copy method.  Nonetheless, if the source and destination Memories are derived from the same underlying base Memory, the source and the destination regions should not overlap within the base Memory region. This is difficult to check at run time, so be warned that this overlap could cause unpredictable results.