how to get endianess in Java or python?

后端 未结 4 1121
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-14 05:08

In C I could the Endianess of the machine by the following method. how would I get using a python or Java program?. In Ja

4条回答
  •  时光说笑
    2021-01-14 05:32

    In Java, it's just

    ByteOrder.nativeOrder();
    

    ...which returns either BIG_ENDIAN or LITTLE_ENDIAN.

    http://docs.oracle.com/javase/6/docs/api/java/nio/ByteOrder.html

提交回复
热议问题