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