Package org.sosy_lab.common.io
Class DuplicateOutputStream
java.lang.Object
java.io.OutputStream
org.sosy_lab.common.io.DuplicateOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
This class is an OutputStream implementation that sends everything to two other OutputStreams.
Exceptions thrown by any of the streams will be relayed to the caller.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()static OutputStreammergeStreams(@Nullable OutputStream stream1, @Nullable OutputStream stream2) Create an output stream that forwards to all given output streams, ignoring null parameters.voidwrite(byte[] pB) voidwrite(byte[] pB, int pOff, int pLen) voidwrite(int pB) Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
DuplicateOutputStream
-
-
Method Details
-
mergeStreams
public static OutputStream mergeStreams(@Nullable OutputStream stream1, @Nullable OutputStream stream2) Create an output stream that forwards to all given output streams, ignoring null parameters. -
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
-