while (true) {
String s2 = raf.readLine();
if (s2 == null) {
// reached the last line
prevLine = null;
Event e = new EventImpl(builder.toString().getBytes(), d.getTime(),
Priority.valueOf(prio), nanos, host,
new HashMap<String, byte[]>());
return e;
}
// valid line, need to get more lines.
Matcher m2 = l4jPat.matcher(s2);
if (m2.matches()) {
// a new matching line? event finished, save line for next round.
Event e = new EventImpl(builder.toString().getBytes(), d.getTime(),
Priority.valueOf(prio), nanos, host,
new HashMap<String, byte[]>());
prevLine = s2;
return e;
}