static final void checkSketchAndMemoryFlags ( final Sketch sketch ) { final Memory mem = sketch . getMemory ( ) ; if ( mem == null ) { return ; } final int flags = PreambleUtil . extractFlags ( mem ) ; if ( ( ( flags & COMPACT_FLAG_MASK ) > 0 ) ^ sketch . isCompact ( ) ) { throw new SketchesArgumentException ( "Possible corruption: " + "Memory Compact Flag inconsistent with Sketch" ) ; } if ( ( ( flags & ORDERED_FLAG_MASK ) > 0 ) ^ sketch . isOrdered ( ) ) { throw new SketchesArgumentException ( "Possible corruption: " + "Memory Ordered Flag inconsistent with Sketch" ) ; } }
Checks Ordered and Compact flags for integrity between sketch and Memory