public void putMemory ( final WritableMemory dstMem , final boolean compact ) { if ( isDirect ( ) && ( isCompact ( ) == compact ) ) { final Memory srcMem = getMemory ( ) ; srcMem . copyTo ( 0 , dstMem , 0 , getStorageBytes ( ) ) ; } else { final byte [ ] byteArr = toByteArray ( compact ) ; final int arrLen = byteArr . length ; final long memCap = dstMem . getCapacity ( ) ; if ( memCap < arrLen ) { throw new SketchesArgumentException ( "Destination Memory not large enough: " + memCap + " < " + arrLen ) ; } dstMem . putByteArray ( 0 , byteArr , 0 , arrLen ) ; } }
Puts the current sketch into the given Memory if there is sufficient space otherwise throws an error .