java - What happens to an Output Stream/Input Stream object reference after calling close method? -


when call close() method on object reference outputstream/inputstream object, object reference pointing null? or need explicitly set null make object memory available gc?

no. close() free underlying resources , objects, object still exists.

actually, close() may not anything, example, in bytearrayinputstream

/**  * closing <tt>bytearrayinputstream</tt> has no effect. methods in  * class can called after stream has been closed without  * generating <tt>ioexception</tt>.  */ public void close() throws ioexception { } 

you can call close() on it, , still use nothing happens.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -