public class TeeOutputStream extends OutputStream
OutputStream that writes all bytes to two
OutputStreams: a base and a tee.| Constructor and Description |
|---|
TeeOutputStream(OutputStream base,
OutputStream tee)
Basic constructor.
|
TeeOutputStream(OutputStream base,
OutputStream tee,
boolean flushTee)
Constructs a stream that optionally flushes the tee after every write.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the base stream, but not the tee.
|
void |
flush()
Flushes all characters currently buffered in the stream.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b)
Writes a single byte to both the base and tee.
|
public TeeOutputStream(OutputStream base, OutputStream tee)
public TeeOutputStream(OutputStream base, OutputStream tee, boolean flushTee)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOException