Package org.apache.tools.ant.util
Class TeeOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.tools.ant.util.TeeOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class TeeOutputStream extends java.io.OutputStreamA simple T-piece to replicate an output stream into two separate streams
-
-
Constructor Summary
Constructors Constructor Description TeeOutputStream(java.io.OutputStream left, java.io.OutputStream right)Constructor for TeeOutputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close both output streams.voidflush()Flush both output streams.voidwrite(byte[] b)Write a byte array to both output streams.voidwrite(byte[] b, int off, int len)Write a byte array to both output streams.voidwrite(int b)Write a byte to both output streams.
-
-
-
Method Detail
-
close
public void close() throws java.io.IOExceptionClose both output streams.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException- on error.
-
flush
public void flush() throws java.io.IOExceptionFlush both output streams.- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException- on error
-
write
public void write(byte[] b) throws java.io.IOExceptionWrite a byte array to both output streams.- Overrides:
writein classjava.io.OutputStream- Parameters:
b- an array of bytes.- Throws:
java.io.IOException- on error.
-
write
public void write(byte[] b, int off, int len) throws java.io.IOExceptionWrite a byte array to both output streams.- Overrides:
writein classjava.io.OutputStream- Parameters:
b- the data.off- the start offset in the data.len- the number of bytes to write.- Throws:
java.io.IOException- on error.
-
write
public void write(int b) throws java.io.IOExceptionWrite a byte to both output streams.- Specified by:
writein classjava.io.OutputStream- Parameters:
b- the byte to write.- Throws:
java.io.IOException- on error.
-
-