question: public static int bytesToInt ( byte [ ] in , ByteOrder order ) { byte [ ] tmp ; if ( order == ByteOrder . LITTLE_ENDIAN ) { tmp = in ; } else { tmp = flipByteOrder ( in ) ; } int ret = 0 ; for ( int i = 0 ; i < tmp . length ; i ++ ) { ret |= ( tmp [ i ] & 0xFF ) << ( i * 8 ) ; } return ret ; }
target:  Byte array to int. Assumes unsigned integer in the byte array