org.apache.tools.ant
Class DemuxOutputStream
OutputStream
org.apache.tools.ant.DemuxOutputStream
public class DemuxOutputStream
extends OutputStream
Logs content written by a thread and forwards the buffers onto the
project object which will forward the content to the appropriate
task.
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(ByteArrayOutputStream buffer) - Converts the buffer to a string and sends it to the project.
|
protected void | processFlush(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.
|
DemuxOutputStream
public DemuxOutputStream(Project project,
boolean isErrorStream)
Creates a new instance of this class.
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.
close
public void close()
throws IOException
Equivalent to flushing the stream.
flush
public void flush()
throws IOException
Writes all remaining data in the buffer associated
with the current thread to the project.
processBuffer
protected void processBuffer(ByteArrayOutputStream buffer)
Converts the buffer to a string and sends it to the project.
buffer
- the ByteArrayOutputStream used to collect the output
until a line separator is seen.
processFlush
protected void processFlush(ByteArrayOutputStream buffer)
Converts the buffer to a string and sends it to the project.
buffer
- the ByteArrayOutputStream used to collect the output
until a line separator is seen.
write
public void write(byte[] b,
int off,
int len)
throws IOException
Write a block of characters to the output stream
b
- the array containing the dataoff
- the offset into the array where data startslen
- the length of block
write
public void write(int cc)
throws IOException
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.
Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.