org.apache.commons.io.testtools
Class YellOnFlushAndCloseOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.apache.commons.io.output.ProxyOutputStream
              extended by org.apache.commons.io.testtools.YellOnFlushAndCloseOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class YellOnFlushAndCloseOutputStream
extends org.apache.commons.io.output.ProxyOutputStream

Helper class for checking behaviour of IO classes.

Author:
Jeremias Maerki

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
YellOnFlushAndCloseOutputStream(java.io.OutputStream proxy, boolean yellForFlush, boolean yellForClose)
           
 
Method Summary
 void close()
           
 void flush()
           
 void off()
           
 
Methods inherited from class org.apache.commons.io.output.ProxyOutputStream
write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YellOnFlushAndCloseOutputStream

public YellOnFlushAndCloseOutputStream(java.io.OutputStream proxy,
                                       boolean yellForFlush,
                                       boolean yellForClose)
Parameters:
proxy - OutputStream to delegate to.
yellForFlush - True if flush() is forbidden
yellForClose - True if close() is forbidden
Method Detail

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class org.apache.commons.io.output.ProxyOutputStream
Throws:
java.io.IOException
See Also:
OutputStream.flush()

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class org.apache.commons.io.output.ProxyOutputStream
Throws:
java.io.IOException
See Also:
OutputStream.close()

off

public void off()


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.