x & 0xFF
will set all bits of x
to zero except for the last byte (which stays the same). If you had used a bitwise or (|
), it would leave the bits of x
set, and set all the bits of the last byte to 1.
Typically, the comparison will be something like (x & 0xFF) == x
. This is to make sure that the first three bytes of x
are all 0.