@Override public void copyTo(BasicBytez other, long otherByteIndex, long myByteIndex, long lenBytes) { if ( other instanceof HeapBytez) { HeapBytez hp = (HeapBytez) other; unsafe.copyMemory(null,baseAdress+myByteIndex, hp.getBase(), hp.getOff()+otherByteIndex,lenBytes); } else { for ( long i = 0; i < lenBytes; i++ ) { other.put(otherByteIndex+i,get(myByteIndex+i)); } } }
@Override public void copyTo(BasicBytez other, long otherByteIndex, long myByteIndex, long lenBytes) { if ( other instanceof HeapBytez) { HeapBytez hp = (HeapBytez) other; unsafe.copyMemory(null,baseAdress+myByteIndex, hp.getBase(), hp.getOff()+otherByteIndex,lenBytes); } else { for ( long i = 0; i < lenBytes; i++ ) { other.put(otherByteIndex+i,get(myByteIndex+i)); } } }