Java tutorial
//package com.java2s; //License from project: Apache License import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { private static void checkByteOrderLittleEndian(final ByteBuffer buffer) { if (buffer.order() != ByteOrder.LITTLE_ENDIAN) { throw new IllegalArgumentException("ByteBuffer byte order must be little endian"); } } }