title: What is the best way to read a text file two lines at a time in Java?
body: <pre><code>BufferedReader in;
  
  String line;
  while ((line = in.readLine() != null) {
      processor.doStuffWith(line);
  }
  </code></pre>
  
  <p>This is how I would process a file line-by-line. In this case, however, I want to send <strong>two</strong> 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.)</p>
  
  <p>What's the best way of doing this in Java?</p>