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 SummaryConstructors Constructor Description TeeOutputStream(java.io.OutputStream left, java.io.OutputStream right)Constructor for TeeOutputStream.
 - 
Method SummaryModifier 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- 
closepublic void close() throws java.io.IOExceptionClose both output streams.- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Overrides:
- closein class- java.io.OutputStream
- Throws:
- java.io.IOException- on error.
 
 - 
flushpublic void flush() throws java.io.IOExceptionFlush both output streams.- Specified by:
- flushin interface- java.io.Flushable
- Overrides:
- flushin class- java.io.OutputStream
- Throws:
- java.io.IOException- on error
 
 - 
writepublic void write(byte[] b) throws java.io.IOExceptionWrite a byte array to both output streams.- Overrides:
- writein class- java.io.OutputStream
- Parameters:
- b- an array of bytes.
- Throws:
- java.io.IOException- on error.
 
 - 
writepublic void write(byte[] b, int off, int len) throws java.io.IOExceptionWrite a byte array to both output streams.- Overrides:
- writein class- java.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.
 
 - 
writepublic void write(int b) throws java.io.IOExceptionWrite a byte to both output streams.- Specified by:
- writein class- java.io.OutputStream
- Parameters:
- b- the byte to write.
- Throws:
- java.io.IOException- on error.
 
 
- 
 
-