| 
 | |||||||||
| 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.util.LineOrientedOutputStream
public abstract class LineOrientedOutputStream
Invokes processLine whenever a full line has
 been written to this stream.
 
Tries to be smart about line separators.
| Constructor Summary | |
|---|---|
| LineOrientedOutputStream() | |
| Method Summary | |
|---|---|
|  void | close()Writes all remaining | 
|  void | flush()Flush this log stream | 
| protected  void | processBuffer()Converts the buffer to a byte[] and sends it to processLine | 
| protected  void | processLine(byte[] line)Processes a line. | 
| protected abstract  void | processLine(java.lang.String line)Processes a line. | 
|  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 LineOrientedOutputStream()
| Method Detail | 
|---|
public final void write(int cc)
                 throws java.io.IOException
write in class java.io.OutputStreamcc - data to log (byte).
java.io.IOException - if there is an error.
public void flush()
           throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOException - if there is an error.
protected void processBuffer()
                      throws java.io.IOException
processLine
java.io.IOException - if there is an error.
protected abstract void processLine(java.lang.String line)
                             throws java.io.IOException
line - the line to log.
java.io.IOException - if there is an error.
protected void processLine(byte[] line)
                    throws java.io.IOException
This implementations invokes the string-arg version converting the byte array using the default encoding. Subclasses are encouraged to override this method (and provide a dummy implementation of the String-arg version) so they don't interfere with the encoding of the underlying stream.
line - the line to log.
java.io.IOException - if there is an error.
public void close()
           throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.OutputStreamjava.io.IOException - if there is an error.
public final 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 | ||||||||