I have a large file (English Wikipedia articles only database as XML files). I am reading one character at a time using BufferedReader
. The pseudocode is:
file = BufferedReader...
while (file.ready())
character = file.read()
Is this actually valid? Or will ready
just return false
when it is waiting for the HDD to return data and not actually when the EOF
has been reached? I tried to use if (file.read() == -1)
but seemed to run into an infinite loop that I literally could not find.
I am just wondering if it is reading the whole file as my statistics say 444,380 Wikipedia pages have been read but I thought there were many more articles.