Android Utililty Methods Bit Check

List of utility methods to do Bit Check

Description

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

Method

booleancheckBit(byte[] src, int index)
new byte[]{00001101} => 0, 2, 3 = true, 1, 4, 5, 6, 7 = false
return checkBit(src, index, true);
booleancheckBit(byte[] src, int index, boolean isLH)
check Bit
return getBitData(src, index, isLH) == 1;
booleancheckBitIsSet(byte bite, int offset)
Returns true if the specified offset bit is set to 1.
if (offset > 7 || offset < 0) {
    throw new IllegalArgumentException(
            "Offset must be between 0 and 7!");
return (bite & (1 << offset)) != 0;
booleanisBitSet(byte[] arr, int bit)
is Bit Set
int index = bit / 8; 
int bitPosition = bit % 8; 
return (arr[index] >> bitPosition & 1) == 1;