close()
method will close the stream of data, and flushes any data that remains in the pipe to the output. So if you dont call the close()
method, the flush is not happening, and the resource is still locked. After the GC
runs, it might find the unclosed streams, and it will close it abruptly where you dont have a mechanism to flush the data to output( there is no output!)