I have a hexadecimal String that I'm converting to its bit representation. The Most significant byte iss Byte 0 and the most significant bit is bit 7. So bits 1-4 which is the lower nibble. For example, if I have a hex String of "01" and I want to get the decimal value of bits 1-4 of byte 1, I would use the below:
String tmp = "0145";
Integer value = Integer.parseInt(tmp.substring(1, 2), 16);
My question would be is there a built in Java function or best practice to then get the value (0 or 1) of bit 4 of the value variable above? I have various bits I need to inspect to see if the values are 0 or 1.