public class TeeOutputStream extends OutputStream
OutputStream
that writes all bytes to two
OutputStream
s: 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 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 void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException