FileDocCategorySizeDatePackage
CloseShieldInputStream.javaAPI DocAndroid 1.5 API1896Wed May 06 22:42:46 BST 2009org.apache.commons.io.input

CloseShieldInputStream

public class CloseShieldInputStream extends ProxyInputStream
Proxy stream that prevents the underlying input stream from being closed.

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

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

Fields Summary
Constructors Summary
public CloseShieldInputStream(InputStream in)
Creates a proxy that shields the given input stream from being closed.

param
in underlying input stream

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

        in = new ClosedInputStream();