com.mindbright.util
Class FlushingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by com.mindbright.util.FlushingOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public final class FlushingOutputStream
extends java.io.FilterOutputStream

This class implements an ouput stream which class flush after each write. It is useful to override the buffering of a BufferedOutputStream when one do not want the buffering (like the one we get from Process.getOutputStream().


Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
FlushingOutputStream(java.io.OutputStream out)
          Creates an flushing output stream
 
Method Summary
 void write(byte[] b, int off, int len)
          See java.io.OutputStream
 void write(int b)
          See java.io.OutputStream
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlushingOutputStream

public FlushingOutputStream(java.io.OutputStream out)
Creates an flushing output stream

Parameters:
expector - class interested in when the expected string occurs
Method Detail

write

public void write(int b)
           throws java.io.IOException
See java.io.OutputStream

Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
See java.io.OutputStream

Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException