public class MultiStream extends OutputStream
Constructor and Description |
---|
MultiStream(OutputStream[] outs)
Create a new multi stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the streams.
|
void |
flush()
Flush the streams.
|
OutputStream[] |
getOutputStreams()
Get the output streams.
|
void |
setEnabled(OutputStream out,
boolean enabled)
Set the enabled state of a stream.
|
void |
setOutputStreams(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.
|
write
public MultiStream(OutputStream[] outs)
outs
- The output streams.public void write(int b) throws IOException
write
in class OutputStream
b
- The byte.IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
b
- The byte.off
- The start offset.len
- The length.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
public OutputStream[] getOutputStreams()
public void setOutputStreams(OutputStream[] outs)
outs
- The output streams.public void setEnabled(OutputStream out, boolean enabled)
out
- The output stream.enabled
- The enabled state.Copyright © 2013. All Rights Reserved.