Timothy Murphy wrote:
>
> On Tue, Feb 02, 1999 at 06:00:22PM -0800, [EMAIL PROTECTED] wrote:
>
> > 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.
>
> Couldn't one write an int to a file,
> and then read it as a character array?
> [Just a slightly random thought.]
I would imagine that if Java is done right the file format the
int will be written in will be specified to have a particular
endian that may or may not really reflect the endian internally.
This must be true since you should be able to hook up two Java
programs talking over a socket and use read/writeInt and not
have to worry about endian. Object serialization would depend
on this so you could un-serialize an object on a different VM
than it was originally written on.
If I wasn't lazy it should be fairly easy to find somewhere in
the Java specs that tells you what endian is used for the data
written out.
--
Brad Pepers
Linux Canada Inc. Home of Linux products in Canada!
http://www.linuxcanada.com Proud supporter of Cyclades, Red
[EMAIL PROTECTED] Hat, and Caldera.