Why don't you set reachedEOF to true?