BufferedReader in;
String line;
while ((line = in.readLine() != null) {
processor.doStuffWith(line);
}
This is how I would process a file line-by-line. In this case, however, I want to send two lines of text to the processor in every iteration. (The text file I'm processing essentially stores one record on two lines, so I'm sending a single record to the processor each time.)
What's the best way of doing this in Java?