public static int littleEndian ( int value ) { int num1 = value ; int mask = 0xff ; int num2 = 0x00 ; num2 |= num1 & mask ; for ( int i = 1 ; i < 4 ; i ++ ) { num2 <<= 8 ; mask <<= 8 ; num2 |= ( num1 & mask ) >> ( 8 * i ) ; } return num2 ; }
Convert an int value to littleEndian