public boolean getBit ( int index ) throws IOException { int byteIndex = index / 8 ; int bitIndex = index % 8 ; validateIndex ( byteIndex , 1 ) ; byte b = getByte ( byteIndex ) ; return ( ( b >> bitIndex ) & 1 ) == 1 ; }
Gets whether a bit at a specific index is set or not .