public static byte [ ] reverseByteArray ( byte [ ] inputByteArray ) { byte [ ] result = new byte [ inputByteArray . length ] ; for ( int i = inputByteArray . length - 1 ; i >= 0 ; i -- ) { result [ result . length - 1 - i ] = inputByteArray [ i ] ; } return result ; }
Reverses the order of the byte array