I need the java code to convert an unsigned byte shifted by 2 to an integer. For example, I have the byte value A0. This converts to the bit pattern: 1010 0000 (or hex -96). This has to be shifted by two to be converted to the bit pattern: 0010 1000 (or hex 28). Then, I need the integer value of that. Merely doing a >> will not work as it is a negative value. >>> gives very weird results.