private void compileBoundaryPattern() {
        int i;
        int j;

        // Precalculate part of the bad character shift
        // It is a table for where in the pattern each
        // lower 7-bit value occurs
        for (i = 0; i < boundaryBytes.length; i++) {
            badCharacters[boundaryBytes[i] & 0x7F] = i + 1;
        }

        // Precalculate the good suffix shift
        // i is the shift amount being considered
        NEXT:
        for (i = boundaryBytes.length; i > 0; i--) {
            // j is the beginning index of suffix being considered
            for (j = boundaryBytes.length - 1; j >= i; j--) {
                // Testing for good suffix
                if (boundaryBytes[j] == boundaryBytes[j - i]) {
                    // src[j..len] is a good suffix
                    goodSuffixes[j - 1] = i;
                } else {
                    // No match. The array has already been
                    // filled up with correct values before.
                    continue NEXT;
                }
            }
            // This fills up the remaining of optoSft
            // any suffix can not have larger shift amount
            // then its sub-suffix. Why???
            while (j > 0) {
                goodSuffixes[--j] = i;
            }
        }
        // Set the guard value because of unicode compression
        goodSuffixes[boundaryBytes.length - 1] = 1;
    }
Boyer-Moore search method.
Copied from {@link Pattern}

<p>Pre calculates arrays needed to generate the bad character shift and the
good suffix shift. Only the last seven bits are used to see if chars
match; This keeps the tables small and covers the heavily used ASCII
range, but occasionally results in an aliased match for the bad character
shift.
core/src/main/java/com/linecorp/armeria/common/multipart/MimeParser.java