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
voidclose()
Writes all remaining
protected voidprocessBuffer()
Converts the buffer to a string and sends it to processLine
voidwrite(int cc)
Write the data to the buffer and flush the buffer, if a line separator is detected.

Constructor Detail

P4OutputStream

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

Parameters: handler the handler which will process the streams

Method Detail

close

public void close()
Writes all remaining

Throws: IOException if an I/O error occurs.

processBuffer

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

write

public void write(int cc)
Write the data to the buffer and flush the buffer, if a line separator is detected.

Parameters: cc data to log (byte).

Throws: IOException IOException if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.