public static boolean matchBitByBitIndex ( final int pVal , final int pBitIndex ) { if ( pBitIndex < 0 || pBitIndex > MAX_BIT_INTEGER ) { throw new IllegalArgumentException ( "parameter 'pBitIndex' must be between 0 and 31. pBitIndex=" + pBitIndex ) ; } return ( pVal & 1 << pBitIndex ) != 0 ; }
Test if bit at given index of given value is = 1 .