As mentioned below, class files are MSB. That is defined in the Java
specification. For serialized objects, one only has to look at the
serialization source code. The specification also indicates that a VM's
internal representation is implementation dependent. The common sense of
most people who tell them that it is LSB on LSB machines, MSB on MSB
machines. It does not matter as long as the interface is consistent.
For PROOF, in the sense of absolute correctness, once must look at the VM
source code. The source code tells you whether it is itself manipulating
the endianess, or whether it is relying on the semantics of the compiler's
generated code. If it is the latter, then one must know the endianess of
the hardware. The interface to the hardware specifies whether it is MSB or
LSB. If you don't believe the specifications, you'll have to infiltrate the
hardware manufacturer's engineering facilities and look at their design. If
you don't believe those, you'll have to infiltrate the fabrication plants
steal a mask, and scrutinize it. If you don't believe what you see, you'll
have to question the laws of natural physics.
>> > I now have two different opinions. Some say Java is big-endian, some
>> > say it depends which machine it's on. Who's right? Proofs, please.
>>
>> Class files and serialized objects are MSB. The endianness of the VM
>> itself is implementation dependent; however, if you could devise a
>> pure-Java program that could detect the endianness of the VM, you
>> would have found a bug in the spec.