public static void sortDescending ( byte [ ] byteArray ) { int index = 0 ; byte value = 0 ; for ( int i = 1 ; i < byteArray . length ; i ++ ) { index = i ; value = byteArray [ index ] ; while ( index > 0 && value > byteArray [ index - 1 ] ) { byteArray [ index ] = byteArray [ index - 1 ] ; index -- ; } byteArray [ index ] = value ; } }
Sort the byte array in descending order using this algorithm .