core/src/main/java/com/twitter/elephantbird/util/StreamSearcher.java
protected void preProcess() {
    int i = 0;
    int j = -1;
    borders_[i] = j;
    while (i < pattern_.length) {
      while (j >= 0 && pattern_[i] != pattern_[j]) {
        j = borders_[j];
      }
      borders_[++i] = ++j;
    }
  }
protected void preProcess() {
    int i = 0;
    int j = -1;
    borders_[i] = j;
    while (i < pattern_.length) {
      while (j >= 0 && pattern_[i] != pattern_[j]) {
        j = borders_[j];
      }
      borders_[++i] = ++j;
    }
  }
Builds up a table of longest "borders" for each prefix of the pattern to find. This table is stored internally
and aids in implementation of the Knuth-Moore-Pratt string search.
<p>
For more information, see: http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/kmpen.htm.