On Thu, 7 Feb 2008, Yegor Kozlov wrote:
With java.io.* streams calling fis.close() twice doesn't do any harm. BUT think of reading via JDBC input streams ( from Oracle or MySQL blobs, etc.). Are you sure they will be happy with closing of already closed stream?

My worry is there will be badly behaved inputstreams out there, which we may start breaking. Servlet engines, odd jdbc drivers etc

What we can do is to create a special constructor:
POIFSFileSystem(InputStream stream, boolean autoClose ).

autoClose=false by default.

That looks good to me. It makes it clearer to users that autoClose isn't automatically done (since there are now two constructors, one which offers it at an option), and allows users who really want autoclose to have it done for them. All without breaking existing code :)

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to