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.
out| 构造器和说明 |
|---|
CloseShieldOutputStream(OutputStream out)
Creates a proxy that shields the given output stream from being
closed.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Replaces the underlying output stream with a
ClosedOutputStream
sentinel. |
afterWrite, beforeWrite, flush, handleIOException, write, write, writepublic CloseShieldOutputStream(OutputStream out)
out - underlying output streampublic void close()
ClosedOutputStream
sentinel. The original output stream will remain open, but this proxy
will appear closed.close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 ProxyOutputStream