java.io.Closeable
, java.io.Flushable
, java.lang.AutoCloseable
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 | Description |
---|---|
CloseShieldOutputStream(java.io.OutputStream out) |
Creates a proxy that shields the given output stream from being
closed.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Replaces the underlying output stream with a
ClosedOutputStream
sentinel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterWrite, beforeWrite, flush, handleIOException, write, write, write
public CloseShieldOutputStream(java.io.OutputStream out)
out
- underlying output streampublic void close()
ClosedOutputStream
sentinel. The original output stream will remain open, but this proxy
will appear closed.close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
close
in class ProxyOutputStream
Copyright (c) 2002-2017 Apache Software Foundation