Java Utililty Methods Bit Clean

List of utility methods to do Bit Clean

Description

The list of methods to do Bit Clean are organized into topic(s).

Method

longclearBit(long n, int i)
clear Bit
return n & ~(1L << i);
booleanclearBit33ofDTS(byte[] array, int offset)
clear Bitof DTS
if ((0x40 & array[7 + offset]) != 0) {
    array[9 + 5 + offset] &= ~8;
    return true;
return false;
intclearBits(int value, int bits)
Clear selected bit(s) in giving value
return value & ~bits;
longclearBits(long value, long bits)
Clears the bits of a value.
return value & ~bits;
intclearBitsAfterInLastWord(int lastWord, int lastSetBit)
clear Bits After In Last Word
return lastWord &= ALL_ZEROS_LITERAL | (0xFFFFFFFF >>> (31 - lastSetBit));
intclearBitsUpToLS(int n, int i)
clear Bits Up To LS
return n & ~(-1 >> (31 - i));