This worked for me to resolve this problem. I'm reading in a file line by line. I'm doing a BufferedReader very early in my program. I then check if the readLine is null and perform a myFile.close and then a new BufferedReader. The first pass through, the readLine variable will be null since I set it that way globally and then haven't done a readLine yet. The variable is defined globally and set to null. As a result, a close and new BufferedReader happens. If I don't do a BufferedReader at the very beginning of my program, then this myFile.close throws an NPE on the first pass.
While the file is reading through line by line, this test fails since the readLine is not null, nothing happens in the test and the rest of the file parsing continues.
Later, when the readLine gets to EOF it is valued as null again. IE: The second pass through this check also does a myFile.close and new BufferedREader which resets the readLine back to the beginning again.
Effectively, inside my loop or outside my loop, this action only happens at the readLine variable being globally set to null or at EOF. In either case I do a "reset" to get back to the beginning of the file and a new BufferedReader.
if (readLineOutput == null) {
//end of file reached or the variable was just set up as null
readMyFile.close();
readMyFile = new BufferedReader(new FileReader("MyFile.txt"));
}