| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.OutputStream
org.apache.tools.ant.DemuxOutputStream
public class DemuxOutputStream
Logs content written by a thread and forwards the buffers onto the project object which will forward the content to the appropriate task.
| Constructor Summary | |
|---|---|
| DemuxOutputStream(Project project,
                  boolean isErrorStream)Creates a new instance of this class. | |
| Method Summary | |
|---|---|
|  void | close()Equivalent to flushing the stream. | 
|  void | flush()Writes all remaining data in the buffer associated with the current thread to the project. | 
| protected  void | processBuffer(java.io.ByteArrayOutputStream buffer)Converts the buffer to a string and sends it to the project. | 
| protected  void | processFlush(java.io.ByteArrayOutputStream buffer)Converts the buffer to a string and sends it to the project. | 
|  void | write(byte[] b,
      int off,
      int len)Write a block of characters to the output stream | 
|  void | write(int cc)Writes the data to the buffer and flushes the buffer if a line separator is detected or if the buffer has reached its maximum size. | 
| Methods inherited from class java.io.OutputStream | 
|---|
| write | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public DemuxOutputStream(Project project,
                         boolean isErrorStream)
project - The project instance for which output is being
                demultiplexed. Must not be null.isErrorStream - true if this is the error string,
                      otherwise a normal output stream. This is
                      passed to the project so it knows
                      which stream it is receiving.| Method Detail | 
|---|
public void write(int cc)
           throws java.io.IOException
write in class java.io.OutputStreamcc - data to log (byte).
java.io.IOException - if the data cannot be written to the streamprotected void processBuffer(java.io.ByteArrayOutputStream buffer)
buffer - the ByteArrayOutputStream used to collect the output
 until a line separator is seen.Project.demuxOutput(String,boolean)protected void processFlush(java.io.ByteArrayOutputStream buffer)
buffer - the ByteArrayOutputStream used to collect the output
 until a line separator is seen.Project.demuxOutput(String,boolean)
public void close()
           throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException - if there is a problem closing the stream.flush()
public void flush()
           throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException - if there is a problem flushing the stream.
public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
write in class java.io.OutputStreamb - the array containing the dataoff - the offset into the array where data startslen - the length of block
java.io.IOException - if the data cannot be written into the stream.| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||