public static byte [ ] encodeInt ( int i ) { byte [ ] raw = new byte [ 4 ] ; raw [ 0 ] = ( byte ) ( i >> 24 ) ; raw [ 1 ] = ( byte ) ( i >> 16 ) ; raw [ 2 ] = ( byte ) ( i >> 8 ) ; raw [ 3 ] = ( byte ) ( i ) ; return raw ; }
Encode an integer into a 4 byte array .