You want the nextLine method to buffer your input. The buffer should contain a block of lines from the file. The method returns the next line from the buffer. If the buffer is empty, refill it with the next block from the file. This is fairly straight forward if all lines are exactly the same length. If not, I doubt that the benefit is worth the effort to get it right.