EndianNumbers { @Pure public static byte[] parseLEInt(int value) { return new byte[] { (byte) (value & 0xFF), (byte) ((value >> 8) & 0xFF), (byte) ((value >> 16) & 0xFF), (byte) ((value >> 24) & 0xFF), }; } private  EndianNumbers(); @Pure static short toBEShort(int b1, int b2); @Pure static short toLEShort(int b1, int b2); @Pure static int toLEInt(int b1, int b2, int b3, int b4); @Pure static int toBEInt(int b1, int b2, int b3, int b4); @Pure static long toLELong(int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8); @Pure static long toBELong(int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8); @Pure @Inline(value = "Double.longBitsToDouble(EndianNumbers.toLELong($1, $2, $3, $4, $5, $6, $7, $8))", imported = {EndianNumbers.class}) static double toLEDouble(int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8); @Pure @Inline(value = "Double.longBitsToDouble(EndianNumbers.toBELong($1, $2, $3, $4, $5, $6, $7, $8))", imported = {EndianNumbers.class}) static double toBEDouble(int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8); @Pure @Inline(value = "Float.intBitsToFloat(EndianNumbers.toLEInt($1, $2, $3, $4))", imported = {EndianNumbers.class}) static float toLEFloat(int b1, int b2, int b3, int b4); @Pure @Inline(value = "Float.intBitsToFloat(EndianNumbers.toBEInt($1, $2, $3, $4))", imported = {EndianNumbers.class}) static float toBEFloat(int b1, int b2, int b3, int b4); @Pure static byte[] parseLEShort(short value); @Pure static byte[] parseLEInt(int value); @Pure @Inline(value = "EndianNumbers.parseLEInt(Float.floatToIntBits($1))", imported = {EndianNumbers.class}) static byte[] parseLEFloat(float value); @Pure static byte[] parseLELong(long value); @Pure @Inline(value = "EndianNumbers.parseLELong(Double.doubleToLongBits($1))", imported = {EndianNumbers.class}) static byte[] parseLEDouble(double value); @Pure static byte[] parseBEShort(short value); @Pure static byte[] parseBEInt(int value); @Pure @Inline(value = "EndianNumbers.parseBEInt(Float.floatToIntBits($1))", imported = {EndianNumbers.class}) static byte[] parseBEFloat(float value); @Pure static byte[] parseBELong(long value); @Pure @Inline(value = "EndianNumbers.parseBELong(Double.doubleToLongBits($1))", imported = {EndianNumbers.class}) static byte[] parseBEDouble(double value);  }
@Test public void parseLEInt() { assertArrayEquals(new byte[]{21, -51, 91, 7}, EndianNumbers.parseLEInt(123456789)); }