public static void reverse ( byte [ ] bytes ) { for ( int i = 0 ; i < bytes . length / 2 ; i ++ ) { byte temp = bytes [ i ] ; bytes [ i ] = bytes [ bytes . length - 1 - i ] ; bytes [ bytes . length - 1 - i ] = temp ; } }
Reverses a byte array in place .