static short[] toShortArray(byte[] bytes, ByteOrder byteOrder) {
            ShortBuffer buffer = ByteBuffer.wrap(bytes).order(byteOrder).asShortBuffer();
            short[] array = new short[buffer.remaining()];
            buffer.get(array);
            return array;