public static Sketch heapify ( final Memory srcMem , final long seed ) { final int serVer = srcMem . getByte ( SER_VER_BYTE ) ; if ( serVer == 3 ) { final byte famID = srcMem . getByte ( FAMILY_BYTE ) ; final boolean ordered = ( srcMem . getByte ( FLAGS_BYTE ) & ORDERED_FLAG_MASK ) != 0 ; return constructHeapSketch ( famID , ordered , srcMem , seed ) ; } if ( serVer == 1 ) { return ForwardCompatibility . heapify1to3 ( srcMem , seed ) ; } if ( serVer == 2 ) { return ForwardCompatibility . heapify2to3 ( srcMem , seed ) ; } throw new SketchesArgumentException ( "Unknown Serialization Version: " + serVer ) ; }
Heapify takes the sketch image in Memory and instantiates an on - heap Sketch using the given seed . The resulting sketch will not retain any link to the source Memory .