public class TeeOutputStream extends OutputStream
OutputStream that sends all data it receives to multiple other output
streams. If an error occurs during a write(int) to one of the
underlying output streams no guarantees are made about how much data is sent
to each stream, i.e. there is no good way to recover from such an error.| Constructor and Description |
|---|
TeeOutputStream(OutputStream... outputStreams)
Creates a new tee output stream that sends all to all given output
streams.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
An effort is made to close all output streams.
|
void |
flush()
An effort is made to flush all output streams.
|
void |
write(byte[] buffer) |
void |
write(byte[] buffer,
int offset,
int length) |
void |
write(int data) |
public TeeOutputStream(OutputStream... outputStreams)
outputStreams - The output streams to send all data topublic void write(int data)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] buffer)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] buffer,
int offset,
int length)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
An effort is made to flush all output streams. If multiple exceptions occur, only the first exception is thrown after all output streams have been tried to flush.
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
An effort is made to close all output streams. If multiple exceptions occur, only the first exception is thrown after all output streams have been tried to close.
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionCopyright © 2026. All rights reserved.