How can I concatenate 2 byte values into a short value in java?
This:
byte b1 = 0xAC;
byte b2 = 0xAD;
short pixelShort = (short) (b1<<8 | b2);
does not work, as the result is 0xFFAD. Why is this?
How can I concatenate 2 byte values into a short value in java?
This:
byte b1 = 0xAC;
byte b2 = 0xAD;
short pixelShort = (short) (b1<<8 | b2);
does not work, as the result is 0xFFAD. Why is this?