First thing, |= is a compound bitwise OR assignment. a |= b is equivalent to a = a | b, where each resulting bit will be set if either that bit in a or b is set (or both).
Here's a truth table that is applied to each bit:
a | b | result
--------------
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 1
Secondly, <<= is the same, but instead of a bitwise or, it's a bit shift to the left. ALl existing bits are moved left by that amount, and the right is padded with 0s.
101 << 1 == 1010
110 << 2 == 11000
final is the same as C++'s const by the variable definition. If, however, you want to prevent a function from being overriden, you may tag final onto the end of the function header if the function is also a virtual function (which it would need to be in order to be overriden in the first place). This only applies to C++11, though. Here's an example of what I mean.
Finally, >>> is called the unsigned right shift operator in Java. Normally, >> will shift the bits, but leave the leftmost bit intact as to preserve the sign of the number. Sometimes that might not be what you want. >>> will put a 0 there all the time, instead of assuming that the sign is important.
In C++, however, signed is an actuality that is part of the variable's type. If a variable is signed, >> will shift right as Java does, but if the variable is unsigned, it will act like the unsigned right shift (>>>) operator in Java. Hence, C++ has only the need for >>, as it can deduce which to do.
unsigned intso there is no need to use an array of bytes. if you have a variableunsigned int x;and you need to convert it tolong, you just do:long y = (long)x;, which is much simpler.