tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronald Albury <ronalb...@gmail.com>
Subject Servlet input/output streams
Date Wed, 22 Jun 2011 15:23:15 GMT
My understanding is that I should *not* close the servlet input/output
streams (if you don't open them - you shouldn't close them)

But what if I have wrapped those streams inside other streams that I want to
close?  Let's say I have several layers of object streams, cipher streams,
compression streams, etc.  Will it be ok to call close on the outer-most
stream, or do I need to rely on the 'flush' and 'finish' methods on these
wrapping streams.

What about the potential for memory leaks - or is that mostly just an issue
on the inner-most stream that actually does the physical I/O?

Thank you for taking the time to read this email.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message