user93796
user93796

Reputation: 18379

How can I detect endianness on a system

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

Answers (1)

CPerkins
CPerkins

Reputation: 9018

Doesn't java.nio.ByteOrder.nativeOrder() give it to you?

Check the source of that.

Upvotes: 5

Related Questions