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
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
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
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