|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
com.gc.iotools.stream.os.CloseOnceOutputStream<T>
T - Type of the OutputStream passed in the constructor.public class CloseOnceOutputStream<T extends OutputStream>
A decorating OutputStream that prevents multiple invocations of
the close() method on the underlying stream.
Multiple invocation of the close() method will result in only
one invocation of the same method on the underlying stream. This is useful
with some non standard OutputStream that don't allow
close() to be called multiple times.
| Field Summary |
|---|
| Fields inherited from class java.io.FilterOutputStream |
|---|
out |
| Constructor Summary | |
|---|---|
CloseOnceOutputStream(T source)
Construct a CloseOnceOutputStream that forwards the calls to
the source OutputStream passed in the constructor. |
|
| Method Summary | |
|---|---|
void |
close()
|
int |
getCloseCount()
Returns the number of time that close was called. |
T |
getWrappedOutputStream()
Returns the wrapped (original) OutputStream passed in the
constructor. |
| Methods inherited from class java.io.FilterOutputStream |
|---|
flush, write, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CloseOnceOutputStream(T source)
CloseOnceOutputStream that forwards the calls to
the source OutputStream passed in the constructor.
source - original OutputStream| Method Detail |
|---|
public void close()
throws IOException
Multiple invocation of this method will result in only one invocation of
the close() on the underlying stream.
close in interface Closeableclose in class FilterOutputStreamIOExceptionpublic int getCloseCount()
com.gc.iotools.stream.is.inspection.DiagnosticOutputStreampublic T getWrappedOutputStream()
Returns the wrapped (original) OutputStream passed in the
constructor.
OutputStream passed in the constructor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||