Reputation: 18379
How can I detect endianness on a system in java?I dont want to use inbuilt methods as its a interview question. Also how to convert big to small and vice versa?
Am looking for ans using Java and not C/C++. I had found such links Detecting endianness programmatically in a C++ program
Upvotes: 0
Views: 424
Reputation: 9018
Doesn't java.nio.ByteOrder.nativeOrder()
give it to you?
Check the source of that.
Upvotes: 5