> >     I would like to ask about a question.  I am doing a JAVA program
> > which should deal with system architeucture.  I would like to ask a
> > question how can I know the system is little endian or big endian?
> 
> Don't know if this helps, but I read in the Java Glossary
> (http://mindprod.com/gloss.html):
> 
>    "Java stores binary values internally and in files MSB (Most
>     Significant Byte) first, i.e. high order part first. This is
>     referred to as big-endian byte sex or sometimes network order."

Rubbish.  They're in MSB in classfiles, but internally, the JVM will
whatever is the platform's way round, otherwise it'll have to
convert everytime it does things like addition (and that would of
course be slow).

On a small-endian machine, the values would only be converted to
big-endian when they're written to a file, or sent out over the network.

Peter


-- 
+---------------------------------------------+-----------------------------+
| Peter Naulls - [EMAIL PROTECTED]              |                             |
| http://free.prohosting.com/~chocky/         | Java and JVM Consultant     |
| Java for Risc OS and ARM - [EMAIL PROTECTED] | Technical Author            |
| http://free.prohosting.com/~chocky/java/    | Program performance analyst |
+---------------------------------------------+-----------------------------+

Reply via email to