I currently have 2 BufferedReader
s initialized on the same text file. When I\'m done reading the text file with the first BufferedReader
, I use the
What's the disadvantage of just creating a new BufferedReader
to read from the top? I'd expect the operating system to cache the file if it's small enough.
If you're concerned about performance, have you proved it to be a bottleneck? I'd just do the simplest thing and not worry about it until you have a specific reason to. I mean, you could just read the whole thing into memory and then do the two passes on the result, but again that's going to be more complicated than just reading from the start again with a new reader.