Re: readInt() & byte order

2001-03-22 Thread Matthias Pfisterer
Matthias Pfisterer wrote: > > Ashish wrote: > > > > Answer is simple > > > > Java program expects file bytes in big-endian format, while C uses little > > endian > > Sorry, wrong. C uses the native byte order of the system. I.e. it > depends on the processor. > x86 (Intel, AMD) => little endian

Re: readInt() & byte order

2001-03-21 Thread Ashish
yep i forgot to mention the paltforms for C -Ashish - Original Message - From: "Matthias Pfisterer" <[EMAIL PROTECTED]> To: "Ashish" <[EMAIL PROTECTED]> Cc: "Joaquin Rapela" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday

Re: readInt() & byte order

2001-03-21 Thread Matthias Pfisterer
Ashish wrote: > > Answer is simple > > Java program expects file bytes in big-endian format, while C uses little > endian Sorry, wrong. C uses the native byte order of the system. I.e. it depends on the processor. x86 (Intel, AMD) => little endian PowerPC, Alpha, Sparc => big endian Matthias

Re: readInt() & byte order

2001-03-21 Thread Ashish
Answer is simple Java program expects file bytes in big-endian format, while C uses little endian 2175 = > 1000 0111 so java will interpret after assuming it's big endian will be 0111 1000 => 32520 -Ashish - Original Message - From: "Joaquin Rapela" <[EMAIL PROTECTED