I have a very simple code snippet which is counting the number of lines in a text file by sequentially reading the lines a BufferedReader and incrementing a counter. There's no problem reading lines with text, or even single blank lines between paragraphs, but once the readLine() method encounters multiple blank lines together it *sometimes* fails to count one or more lines, according to a pattern I can't quite determine.
Does anyone know what sort of checks I need to perform to make sure that all lines (even the blank ones) are counted until the EOF?
Does anyone know what sort of checks I need to perform to make sure that all lines (even the blank ones) are counted until the EOF?