[Fix] ByteHelper.getUpperNibble() was broken for signed values
This commit is contained in:
parent
6328827f9e
commit
23007aae2f
|
@ -247,11 +247,11 @@ public class ByteHelper {
|
|||
}
|
||||
|
||||
public static byte getUpperNibble(byte b) {
|
||||
return (byte) ((byte) (0xf0 & b) >> 4);
|
||||
return (byte) (b >>> 4 & 0x0f);
|
||||
}
|
||||
|
||||
public static byte getLowerNibble(byte b) {
|
||||
return (byte) (0xf & b);
|
||||
return (byte) (0x0f & b);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue