org.apache.tools.ant.taskdefs.optional.perforce

Class P4OutputStream


public class P4OutputStream
extends OutputStream

heavily inspired from LogOutputStream this stream class calls back the P4Handler on each line of stdout or stderr read

Constructor Summary

P4OutputStream(P4Handler handler)
creates a new P4OutputStream for a P4Handler

Method Summary

void
close()
Writes all remaining
protected void
processBuffer()
Converts the buffer to a string and sends it to processLine
void
write(int cc)
Write the data to the buffer and flush the buffer, if a line separator is detected.

Constructor Details

P4OutputStream

public P4OutputStream(P4Handler handler)
creates a new P4OutputStream for a P4Handler
Parameters:
handler - the handler which will process the streams

Method Details

close

public void close()
            throws IOException
Writes all remaining

processBuffer

protected void processBuffer()
Converts the buffer to a string and sends it to processLine

write

public void write(int cc)
            throws IOException
Write the data to the buffer and flush the buffer, if a line separator is detected.
Parameters:
cc - data to log (byte).

Copyright B) 2000-2006 Apache Software Foundation. All Rights Reserved.