net.sf.farrago.test
Class FarragoTestCase.ReplacingOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by net.sf.farrago.test.FarragoTestCase.ReplacingOutputStream
All Implemented Interfaces:
Closeable, Flushable
Enclosing class:
FarragoTestCase

private static class FarragoTestCase.ReplacingOutputStream
extends FilterOutputStream

Stream which applies regular expression replacement to its contents.

Lame implementation which buffers its input and applies replacement only when close() is called.


Field Summary
private  OutputStream outputStream
           
private  String replace
           
private  String seekPattern
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
FarragoTestCase.ReplacingOutputStream(OutputStream outputStream, String seekPattern, String replace)
           
 
Method Summary
 void close()
           
 
Methods inherited from class java.io.FilterOutputStream
flush, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputStream

private final OutputStream outputStream

seekPattern

private final String seekPattern

replace

private final String replace
Constructor Detail

FarragoTestCase.ReplacingOutputStream

public FarragoTestCase.ReplacingOutputStream(OutputStream outputStream,
                                             String seekPattern,
                                             String replace)
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class FilterOutputStream
Throws:
IOException