S
Stefan Ram
The operation »close()« is mentioned in the class documentation
http://java.sun.com/javase/6/docs/api/java/io/BufferedInputStream.html
But nowhere does it recommend to use »close()«.
I had expected the constructor documentation to
say something like
»Whenever an object of this class has been constructed
successfully it needs to be closed at some instant in the
future to avoid resource leaks, because only by closing
all resource allocated by the construction will be
released again.«
But this is not so.
The tutorial also does not recommend close:
http://java.sun.com/docs/books/tutorial/essential/io/buffers.html
I used to believe that closing was important.
Why is it not recommended in the documentation nor the tutorial?
(When insisting on the use of »close()«, I'd
like to have some evidence for its necessity.)
http://java.sun.com/javase/6/docs/api/java/io/BufferedInputStream.html
But nowhere does it recommend to use »close()«.
I had expected the constructor documentation to
say something like
»Whenever an object of this class has been constructed
successfully it needs to be closed at some instant in the
future to avoid resource leaks, because only by closing
all resource allocated by the construction will be
released again.«
But this is not so.
The tutorial also does not recommend close:
http://java.sun.com/docs/books/tutorial/essential/io/buffers.html
I used to believe that closing was important.
Why is it not recommended in the documentation nor the tutorial?
(When insisting on the use of »close()«, I'd
like to have some evidence for its necessity.)