code: int nextState(int state, int input, int bufPos) {
      switch (state) {
      case CDATA_UNK:
      case CDATA_OUT:
        switch (input) {
        case CDATA_BEGIN:
          return CDATA_IN;
        case CDATA_END:
          if (state == CDATA_OUT) {
            //System.out.println("buggy XML " + bufPos);
          }
          return CDATA_OUT;
        case RECORD_MAYBE:
          return (state == CDATA_UNK) ? CDATA_UNK : RECORD_ACCEPT;
        }
        break;
      case CDATA_IN:
        return (input == CDATA_END) ? CDATA_OUT : CDATA_IN;
      }
      throw new IllegalStateException(state + " " + input + " " + bufPos + " " + splitName_);
    }
docs: /* also updates firstMatchStart_;