@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class TeeOutputStream extends FilterOutputStream
Modifier and Type | Field and Description |
---|---|
protected OutputStream |
branch
the second OutputStream to write to
|
out
Constructor and Description |
---|
TeeOutputStream(OutputStream out,
OutputStream branch)
Constructs a TeeOutputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes both streams.
|
void |
flush()
Flushes both streams.
|
void |
write(byte[] b)
Write the bytes to both streams.
|
void |
write(byte[] b,
int off,
int len)
Write the specified bytes to both streams.
|
void |
write(int b)
Write a byte to both streams.
|
protected OutputStream branch
public TeeOutputStream(OutputStream out, OutputStream branch)
out
- the main OutputStreambranch
- the second OutputStreampublic void write(@NonNull byte[] b) throws IOException
write
in class FilterOutputStream
b
- the bytes to writeIOException
- if an I/O error occurspublic void write(@NonNull byte[] b, int off, int len) throws IOException
write
in class FilterOutputStream
b
- the bytes to writeoff
- The start offsetlen
- The number of bytes to writeIOException
- if an I/O error occurspublic void write(int b) throws IOException
write
in class FilterOutputStream
b
- the byte to writeIOException
- if an I/O error occurspublic void flush() throws IOException
flush
in interface Flushable
flush
in class FilterOutputStream
IOException
- if an I/O error occurspublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterOutputStream
IOException
- if an I/O error occursCopyright © 2004–2022. All rights reserved.