private static void computeBadByteSkipArray ( byte [ ] pattern , int [ ] badByteArray ) { for ( int a = 0 ; a < ALPHABET_SIZE ; a ++ ) { badByteArray [ a ] = pattern . length ; } for ( int j = 0 ; j < pattern . length - 1 ; j ++ ) { badByteArray [ pattern [ j ] - Byte . MIN_VALUE ] = pattern . length - j - 1 ; } }
Fills the Boyer Moore bad character array for the given pattern