java.lang.Object
java.io.OutputStream
org.refcodes.io.OutputStreamComposite
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
A
OutputStreamComposite wraps multiple OutputStream instances
to which to dispatch any operation applied to the
OutputStreamComposite instance. This implementation does not use
threads so you may have take care on the order of the OutputStream
instances passed to the constructor(s) as the operations a dispatched to the
OutputStream instances in that order as they were provided. The
OutputStreamComposite is most useful when capturing data written to
an OutputStream e.g. with the HexOutputStream type.-
Constructor Summary
ConstructorsConstructorDescriptionOutputStreamComposite(OutputStream... aOutputStreams) Constructs aOutputStreamCompositewith the givenOutputStreaminstances to which to spread the data written to thisOutputStreamCompositeinstance. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
OutputStreamComposite
Constructs aOutputStreamCompositewith the givenOutputStreaminstances to which to spread the data written to thisOutputStreamCompositeinstance.- Parameters:
aOutputStreams- TheOutputStreaminstances to which all operations are to be dispatched.
-
-
Method Details
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Overrides:
writein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-