BufferedReader in; String line; while ((line = in.readLine() != null) { processor.doStuffWith(line); }
This is how I would process a file line