static void incrementKey ( byte [ ] key ) { for ( int i = key . length - 1 ; i >= 0 ; i -- ) { int v = key [ i ] & 0xff ; if ( v < 0xff ) { key [ i ] = ( byte ) ( v + 1 ) ; return ; } key [ i ] = 0 ; } }
Increment a key .