net.spy.log
Class LineGettingOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended bynet.spy.log.LineGettingOutputStream
Direct Known Subclasses:
LoggingOutputStream, MessageOutputStream

public abstract class LineGettingOutputStream
extends OutputStream

An output stream that processes a line at a time.


Constructor Summary
LineGettingOutputStream()
          Get an instance of LineGettingOutputStream.
 
Method Summary
protected abstract  void processChunk(String chunk)
          Deal with a chunk of data.
 void setErr()
          Redefine stderr to send messages via this thing.
 void setOut()
          Redefine stdout to send messages via this thing.
 void write(byte[] b, int offset, int length)
          Do the actual writing.
 void write(int b)
          Write a byte.
 
Methods inherited from class java.io.OutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineGettingOutputStream

public LineGettingOutputStream()
Get an instance of LineGettingOutputStream.

Method Detail

write

public void write(int b)
           throws IOException
Write a byte.

Throws:
IOException

write

public void write(byte[] b,
                  int offset,
                  int length)
           throws IOException
Do the actual writing.

Throws:
IOException

processChunk

protected abstract void processChunk(String chunk)
                              throws IOException
Deal with a chunk of data.

Parameters:
chunk - the chunk of data to process
Throws:
IOException - if there's a problem processing it

setErr

public void setErr()
Redefine stderr to send messages via this thing.


setOut

public void setOut()
Redefine stdout to send messages via this thing.