public class MultiOutputStream extends OutputStream
MultiOutputStream is a collection of constituent
OutputStream objects, to which all output is forwarded.
Thanks to Ian F. Darwin for his implementation of a similar concept.
| Constructor and Description |
|---|
MultiOutputStream(OutputStream... os)
Forwards output to a list of output streams.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOutputStream(OutputStream os)
Adds an output stream to those receiving this stream's output.
|
void |
close() |
void |
flush() |
void |
removeOutputStream(OutputStream os)
Removes an output stream from those receiving this stream's output.
|
void |
write(byte[] buf,
int off,
int len) |
void |
write(int b) |
writepublic MultiOutputStream(OutputStream... os)
os - Output streams which will receive this stream's output.public void addOutputStream(OutputStream os)
public void removeOutputStream(OutputStream os)
public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] buf,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionCopyright © 2015–2022 SciJava. All rights reserved.