code: private int stateLength(int state) {
      int arc = state;
      while (!isArcLast(arc)) {
        arc += ARC_SIZE;
      }
      return arc - state + ARC_SIZE;
    }
docs: The total length of the serialized state data (all arcs).