public class CloseShieldOutputStream extends ProxyOutputStream
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.
|Constructor and Description|
Using this constructor prevents IDEs from warning if the underlying output stream is never closed. Use
|Modifier and Type||Method and Description|
Replaces the underlying output stream with a
Creates a proxy that shields the given output stream from being closed.
afterWrite, beforeWrite, flush, handleIOException, write, write, write
@Deprecated public CloseShieldOutputStream(OutputStream outputStream)
outputStream- underlying output stream
public static CloseShieldOutputStream wrap(OutputStream outputStream)
outputStream- the output stream to wrap
public void close()
ClosedOutputStreamsentinel. The original output stream will remain open, but this proxy will appear closed.
Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.