public static int computeSizeBytes ( long maxNumEntries ) { // copied from constructor checkArgument ( maxNumEntries > 0 , "expectedEntries should be > 0" ) ; long numBits = optimalNumOfBits ( maxNumEntries , DEFAULT_FPP ) ; int nLongs = ( int ) Math . ceil ( ( double ) numBits / ( double ) Long . SIZE ) ; int padLongs = DEFAULT_BLOCK_SIZE - nLongs % DEFAULT_BLOCK_SIZE ; return START_OF_SERIALIZED_LONGS + ( ( nLongs + padLongs ) * Long . BYTES ) ; }
Calculate size in bytes of a BloomKFilter for a given number of entries