public int getBit ( int index ) { assert index >= 0 && index < numBits ; int i = index >> 6 ; // div 64 int bit = index & 0x3f ; // mod 64 return ( ( int ) ( bits [ i ] >>> bit ) ) & 0x01 ; }
returns 1 if the bit is set 0 if not . The index should be less than the OpenBitSet size