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
ConstructorDescriptionOutputStreamComposite
(OutputStream... aOutputStreams) Constructs aOutputStreamComposite
with the givenOutputStream
instances to which to spread the data written to thisOutputStreamComposite
instance. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
OutputStreamComposite
Constructs aOutputStreamComposite
with the givenOutputStream
instances to which to spread the data written to thisOutputStreamComposite
instance.- Parameters:
aOutputStreams
- TheOutputStream
instances to which all operations are to be dispatched.
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-