Is there an easy and elegant way to convert an unsigned byte value to a signed byte value in java? For example, if all I have is the int value 240 (in binary (24 bits + 1111
public int getUnsignedByte(byte[] bytes, int offset) { return (bytes[offset] & 0xFF); }
should do the work.