public class TeeOutputStream
extends java.io.OutputStream
Constructor and Description |
---|
TeeOutputStream(java.io.OutputStream left,
java.io.OutputStream right)
Constructor for TeeOutputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close both output streams.
|
void |
flush()
Flush both output streams.
|
void |
write(byte[] b)
Write a byte array to both output streams.
|
void |
write(byte[] b,
int off,
int len)
Write a byte array to both output streams.
|
void |
write(int b)
Write a byte to both output streams.
|
public TeeOutputStream(java.io.OutputStream left, java.io.OutputStream right)
left
- one of the output streams.right
- the other output stream.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
- on error.public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- on errorpublic void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
b
- an array of bytes.java.io.IOException
- on error.public void write(byte[] b, int off, int len) throws java.io.IOException
write
in class java.io.OutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.java.io.IOException
- on error.public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
b
- the byte to write.java.io.IOException
- on error.