Bit Manipulation
suggest changeRemarks
- Bitwise operators on
intandlongdo not depend on the CPU’s endianness. Endianness matters when multi-byte values are stored in memory or on a stream.ByteBufferis big-endian unless you set the order. - The
bytetype is signed, with the range -128 to +127. To convert a byte value to its unsigned equivalent, mask it with 0xFF like this:(b & 0xFF).
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents