private int readInt() throws IOException {
    int c;
    int ret = 0;

    boolean foundDigit = false;
    while (Character.isDigit(c = read(false))) {
      foundDigit = true;
      ret = ret * 10 + (c - '0');
    }

    if (!foundDigit) {
      unread(c);
      return -1;
    }
    if (c != -1) {
      unread(c);
    }

    return ret;
  }
Read a positive integer and convert it from decimal text form.
EOF silently terminates the number.
ql/src/java/org/apache/hadoop/hive/ql/log/syslog/SyslogParser.java