net.spy.log
Class LineGettingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by net.spy.log.LineGettingOutputStream
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
LoggingOutputStream

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.

Specified by:
write in class OutputStream
Throws:
IOException

write

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

Overrides:
write in class OutputStream
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.



Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.