public class CloseShieldInputStream extends ProxyInputStream
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.
|Constructor and Description|
Using this constructor prevents IDEs from warning if the underlying input stream is never closed. Use
|Modifier and Type||Method and Description|
Replaces the underlying input stream with a
Creates a proxy that shields the given input stream from being closed.
afterRead, available, beforeRead, handleIOException, mark, markSupported, read, read, read, reset, skip
@Deprecated public CloseShieldInputStream(InputStream inputStream)
inputStream- underlying input stream
public static CloseShieldInputStream wrap(InputStream inputStream)
inputStream- the input stream to wrap
public void close()
ClosedInputStreamsentinel. The original input stream will remain open, but this proxy will appear closed.
Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.