There is a number of type int <= 65545 . You need to get the lower and upper 8 bits. I figured out the “older 8 bits”, it’s enough to shift to the right with zero filling ( >>>8 ). But I don’t understand with the younger ones.

older younger

| ----------- || ----------- |

1111111100000000

    1 answer 1

    It is enough to reset the high bits.

     int a = 0x1234; int bigA = a >>> 8; int lowA = a & 0xff;