No problems because you use it on a StringReader
. When the scope of the BufferedReder
is left it will be eligible for garbage collection.
It would be a problem if you did not close e.g a FileReader
because the system resource would not be closed properly and there might be a read-lock on the file until the program ends.
When writing it might be a problem, because the data might never be written to the file because of buffering.