Is there anyway to check whether an OutputStream is closed without attempting to write to it and catching the IOException?
For example, consider the fol
The OutputStream itself does not support such a method. The Closable interface is defined in a way that once you call close() you are going to dispose of that OutputStream.
Maybe you should revisit a bit the design of the application and check why you're not doing that and you're ending up with a closed OutputStream instance still running around in your application.