static long checkPreambleSize ( final Memory mem ) { final long cap = mem . getCapacity ( ) ; if ( cap < 8 ) { throwNotBigEnough ( cap , 8 ) ; } final long pre0 = mem . getLong ( 0 ) ; final int preLongs = ( int ) ( pre0 & 0X3F L ) ; //lower 6 bits final int required = Math . max ( preLongs << 3 , 8 ) ; if ( cap < required ) { throwNotBigEnough ( cap , required ) ; } return pre0 ; }
Checks Memory for capacity to hold the preamble and returns the first 8 bytes .