How to find machine is Big/little endian?

Hi,

Can any one tell me that how to find machine on which we are working i.e. Big/Little Endian in using java?

One of my friend told me that in C Programming we can find this by using following code:

#include <stdio.h>

#include <arpa/inet.h>

int main(){

if (htons(1) == 1) puts("big endian");

else puts("little endian");

return 0;

}

Can any one help me in solving this mystery?

Cheers,

Ram

[715 byte] By [krishnad_194@yahoo.coma] at [2007-10-3 4:13:04]
# 1
java.nio.ByteOrder.nativeOrder();~D
aconst_nulla at 2007-7-14 22:13:59 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks buddy
krishnad_194@yahoo.coma at 2007-7-14 22:13:59 > top of Java-index,Java Essentials,Java Programming...