|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
org.zeroturnaround.exec.stream.LogOutputStream
public abstract class LogOutputStream
Base class to connect a logging system to the output and/or error stream of then external process. The implementation parses the incoming data to construct a line and passes the complete line to an user-defined implementation.
| Constructor Summary | |
|---|---|
LogOutputStream()
|
|
| Method Summary | |
|---|---|
void |
close()
Writes all remaining data from the buffer. |
void |
flush()
Flush this log stream. |
protected void |
processBuffer()
Converts the buffer to a string and sends it to processLine. |
protected abstract void |
processLine(String line)
Logs a line to the log system of the user. |
void |
write(byte[] b,
int off,
int len)
Write a block of characters to the output stream |
void |
write(int cc)
Write the data to the buffer and flush the buffer, if a line separator is detected. |
| 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 LogOutputStream()
| Method Detail |
|---|
public void write(int cc)
throws IOException
write in class OutputStreamcc - data to log (byte).
IOExceptionOutputStream.write(int)public void flush()
flush in interface Flushableflush in class OutputStreamOutputStream.flush()
public void close()
throws IOException
close in interface Closeableclose in class OutputStreamIOExceptionOutputStream.close()
public void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamb - the array containing the dataoff - the offset into the array where data startslen - the length of block
IOException - if the data cannot be written into the stream.OutputStream.write(byte[], int, int)protected void processBuffer()
processLine.
protected abstract void processLine(String line)
line - the line to log.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||