Wednesday, May 14, 2008

Finding native-endian in Java

I was getting curious about if its possible to write a Java program that finds if the underlying native platform is little- or big-endian. I guess its not possible to write such a program without having part of the code in C/C++ and using JNI. If anyone reading this blog feels otherwise, please let me know.

There is an API available from NIO to find out the native-endian. I think this API should use some native code underneath.