What endianness does Java use in its virtual machine? I remember reading somewhere that it depends on the physical machine it’s running on, and then other places I have read that it is always, I believe, big endian. Which is correct?
What endianness does Java use in its virtual machine? I remember reading somewhere that
Share
Multibyte data in the
classfiles are stored big-endian.From The Java Virtual Machine Specification, Java SE 7 Edition, Chapter 4: The
classFile Format:Furthermore, the operand in an bytecode instruction is also big-endian if it spans multiple bytes.
From The Java Virtual Machine Specification, Java SE 7 Edition, Section 2.11: Instruction Set Summary:
So yes, I think it can be said that the Java Virtual Machine uses big-endian.