public static boolean isReverseSorted ( byte [ ] byteArray ) { for ( int i = 0 ; i < byteArray . length - 1 ; i ++ ) { if ( byteArray [ i ] < byteArray [ i + 1 ] ) { return false ; } } return true ; }
Check if the byte array is reverse sorted . It loops through the entire byte array once checking that the elements are reverse sorted .