Is there anyway to check whether an OutputStream is closed without attempting to write to it and catching the IOException
?
For example, consider the following contrived method:
public boolean isStreamClosed(OutputStream out){
if( /* stream isn't closed */){
return true;
}else{
return false;
}
}
What could you replace /* stream isn't closed */
with?