public class TeeOutputStream extends ProxyOutputStream
| 限定符和类型 | 字段和说明 |
|---|---|
protected OutputStream |
branch
the second OutputStream to write to
|
out| 构造器和说明 |
|---|
TeeOutputStream(OutputStream out,
OutputStream branch)
Constructs a TeeOutputStream.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Closes both output 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.
|
afterWrite, beforeWrite, handleIOExceptionprotected OutputStream branch
public TeeOutputStream(OutputStream out, OutputStream branch)
out - the main OutputStreambranch - the second OutputStreampublic void write(byte[] b)
throws IOException
write 在类中 ProxyOutputStreamb - the bytes to writeIOException - if an I/O error occurspublic void write(byte[] b,
int off,
int len)
throws IOException
write 在类中 ProxyOutputStreamb - 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 在类中 ProxyOutputStreamb - the byte to writeIOException - if an I/O error occurspublic void flush()
throws IOException
flush 在接口中 Flushableflush 在类中 ProxyOutputStreamIOException - if an I/O error occurspublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 ProxyOutputStreamIOException - if an I/O error occurs