private byte[] readPid() throws IOException {
    ByteArrayOutputStream ret = new ByteArrayOutputStream(8);
    int c;

    expect('[');

    while ((c = read(true)) != ']' && c != '\r' && c != '\n') {
      ret.write(c);
    }

    return ret.toByteArray();
  }
Read a RFC 3164 pid.
The format is "[1234]".
ql/src/java/org/apache/hadoop/hive/ql/log/syslog/SyslogParser.java