posted 22 years ago
Hi,
I have a question, if I am using a local FileInputStream object to open an input stream do I need to explicitly close it? I know its a good practice to do so, but is it really required to avoid leaving a socket connection hanging.
I think as the FileInputStream object cease to exist after the method call I can get away without closing the input stream , even though for sake of safety I am closing it before returning.
Please tell me whether the JVM will handle the close connection for me or I have to do it explicitly.
Regards,
Vijay