code: private static int[] makeOffsetTable(byte[] needle) {
          int l = needle.length;
          int[] table = new int[l];
          int lastPrefixPosition = l;
          for (int i = l - 1; i >= 0; --i) {
              if (isPrefix(needle, i + 1)) {
                  lastPrefixPosition = i + 1;
              }
              table[l - 1 - i] = lastPrefixPosition - i + l - 1;
          }
          for (int i = 0; i < l - 1; ++i) {
              int slen = suffixLength(needle, i);
              table[slen] = l - 1 - i + slen;
          }
          return table;
      }
docs: Makes the jump table based on the scan offset which mismatch occurs.