List of utility methods to do Bit Check
boolean | checkBit(byte[] src, int index) new byte[]{00001101} => 0, 2, 3 = true, 1, 4, 5, 6, 7 = false return checkBit(src, index, true);
|
boolean | checkBit(byte[] src, int index, boolean isLH) check Bit return getBitData(src, index, isLH) == 1;
|
boolean | checkBitIsSet(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; |
boolean | isBitSet(byte[] arr, int bit) is Bit Set int index = bit / 8; int bitPosition = bit % 8; return (arr[index] >> bitPosition & 1) == 1; |