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) |
write
public 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 OutputStream
IOException
public void write(byte[] buf, int off, int len) throws IOException
write
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
Copyright © 2015–2022 SciJava. All rights reserved.