org.apache.commons.io.input

Class 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

Constructor Summary

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

Method Summary

void
close()
Replaces the underlying input stream with a ClosedInputStream sentinel.

Methods inherited from class org.apache.commons.io.input.ProxyInputStream

available, close, mark, markSupported, read, read, read, reset, skip

Constructor Details

CloseShieldInputStream

public CloseShieldInputStream(InputStream in)
Creates a proxy that shields the given input stream from being closed.
Parameters:
in - underlying input stream

Method Details

close

public void close()
Replaces the underlying input stream with a ClosedInputStream sentinel. The original input stream will remain open, but this proxy will appear closed.
Overrides:
close in interface ProxyInputStream

Copyright (c) 2002-2009 Apache Software Foundation