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

    while ((c = read(false)) != '\n' && c != -1) {
      if (c != '\r') {
        ret.write(c);
      } else {
        // CR replaced with LF
        ret.write('\n');
      }
    }

    return ret.toByteArray();
  }
Read a line (until next ASCII NL or EOF) as a byte array.
ql/src/java/org/apache/hadoop/hive/ql/log/syslog/SyslogParser.java