This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
It's a little clearer this time around ... you can make a String array as a "buffer" of some number of lines. Read lines into the array and process the array. Repeat until you hit end of file.
I'm curious why a buffer of 10 or 100 or 1000 lines might be better than, say, 1. Read a line, process it. Java's BufferedReader already optimizes physical disk reads with buffering very much like the string array just so we don't have to worry about such things.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi