public class MultiStream
extends java.io.OutputStream
Modifier and Type | Field and Description |
---|---|
protected java.util.Set |
disabled
The disabled streams.
|
protected java.io.OutputStream[] |
outs
The output streams.
|
Constructor and Description |
---|
MultiStream(java.io.OutputStream[] outs)
Create a new multi stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the streams.
|
void |
flush()
Flush the streams.
|
java.io.OutputStream[] |
getOutputStreams()
Get the output streams.
|
void |
setEnabled(java.io.OutputStream out,
boolean enabled)
Set the enabled state of a stream.
|
void |
setOutputStreams(java.io.OutputStream[] outs)
Set the output streams.
|
void |
write(byte[] b,
int off,
int len)
Write a byte array to the streams.
|
void |
write(int b)
Write a byte to the streams.
|
protected java.io.OutputStream[] outs
protected java.util.Set disabled
public MultiStream(java.io.OutputStream[] outs)
outs
- The output streams.public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- The byte.java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
b
- The byte.off
- The start offset.len
- The length.java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public java.io.OutputStream[] getOutputStreams()
public void setOutputStreams(java.io.OutputStream[] outs)
outs
- The output streams.public void setEnabled(java.io.OutputStream out, boolean enabled)
out
- The output stream.enabled
- The enabled state.