docs: private static int parseInt(Input s) {
      if (s.index >= s.len) throw new DateFormatException("unexpected end of input", s.str, s.index);
      int result = 0;
      while (s.index < s.len) {
        char c = s.getChar();
        if (c >= '0' && c <= '9') {
          if (result >= Integer.MAX_VALUE / 10) throw new ArithmeticException("Field too large.");
          result = result * 10 + ((int)c - (int)'0');
          s.index++;
        } else {
          break;
        }
      }
      return result;
    }