public static void shuffle ( byte [ ] array , int offset , int length , Random rand ) { for ( int i = 0 ; i < length ; i ++ ) { int src = rand . nextInt ( length - i ) ; byte tmp = array [ offset + src + i ] ; array [ offset + src + i ] = array [ offset + i ] ; array [ offset + i ] = tmp ; } }
Randomly shuffle the array