On Sun, 31 Jan 1999, Leung Yau Wai wrote:
> On Sat, 30 Jan 1999, Aaron Gaudio wrote:
>
> Many people will feel I very strange since I would like to know
> the system endianess. Since I am working JNI so I need to concern about
> it. So, I think I can determine it from the System property class! But
> it is hard to know the endianess of all JAVA porting platform!
>
You could let the JNI part of your program try to detect endianness:
char tmp[2];
short *s = (short *) tmp;
tmp[0] = 0xaa;
tmp[1] = 0xbb;
if(s == 0xbbaa)
; /* little, x86 etc */
else
;
Any errors in the code above is the result of my brain not functioning
properly at this time of day ...
/Urban
---
Urban Widmark [EMAIL PROTECTED]
Svenska Test AB +46 90 71 71 23