for(String line : readLines(System.in)) { //do something with line here }
If it's the latter, I don't bother creating many abstractions.