Package net.targetr.rc.client
Class MultiOutputStream
java.lang.Object
java.io.OutputStream
net.targetr.rc.client.MultiOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
An output stream that writes to multiple output streams simultaneously.
-
Constructor Summary
ConstructorsConstructorDescriptionMultiOutputStream(OutputStream... out) Creates a new MultiOutputStream that writes to the given output streams. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Flushes all output streams.voidwrite(byte[] b) Writes the specified byte array to all output streams.voidwrite(byte[] b, int off, int len) Writes the specified byte array to all output streams.voidwrite(int b) Writes the specified byte to all output streams.Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
Constructor Details
-
MultiOutputStream
Creates a new MultiOutputStream that writes to the given output streams.- Parameters:
out- The output streams to write to.
-
-
Method Details
-
write
Writes the specified byte to all output streams.- Specified by:
writein classOutputStream- Parameters:
b- The byte to write.- Throws:
IOException- If an I/O error occurs.
-
write
Writes the specified byte array to all output streams.- Overrides:
writein classOutputStream- Parameters:
b- The byte array to write.- Throws:
IOException- If an I/O error occurs.
-
write
Writes the specified byte array to all output streams.- Overrides:
writein classOutputStream- Parameters:
b- The byte array to write.off- The offset in the byte array to start writing from.len- The number of bytes to write.- Throws:
IOException- If an I/O error occurs.
-
close
Flushes all output streams.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException- If an I/O error occurs.
-