FileDocCategorySizeDatePackage
CloseShieldOutputStream.javaAPI DocAndroid 1.5 API1914Wed May 06 22:42:46 BST 2009org.apache.commons.io.output

CloseShieldOutputStream

public class CloseShieldOutputStream extends ProxyOutputStream
Proxy stream that prevents the underlying output stream from being closed.

This class is typically used in cases where an output stream needs to be passed to a component that wants to explicitly close the stream even if other components would still use the stream for output.

version
$Id: CloseShieldOutputStream.java 587913 2007-10-24 15:47:30Z niallp $
since
Commons IO 1.4

Fields Summary
Constructors Summary
public CloseShieldOutputStream(OutputStream out)
Creates a proxy that shields the given output stream from being closed.

param
out underlying output stream

        super(out);
    
Methods Summary
public voidclose()
Replaces the underlying output stream with a {@link ClosedOutputStream} sentinel. The original output stream will remain open, but this proxy will appear closed.

        out = new ClosedOutputStream();