160 Contributors: 12 Wednesday, April 5, 2017
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial:
Roadmap: roadmap
Download eBook

Bit Manipulation

Download java eBook


  • Unlike C/C++, Java is completely endian-neutral with respect to the underlying machine hardware. You do not get big or little endian behavior by default; you have to explicitly specify which behavior you want.

  • The byte type 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).

Related Examples