bb.io
Class StreamDrainerForwarding.UnitTest.Crashes

java.lang.Object
  extended by bb.io.StreamDrainerForwarding
      extended by bb.io.StreamDrainerForwarding.UnitTest.Crashes
All Implemented Interfaces:
StreamDrainer, Runnable
Enclosing class:
StreamDrainerForwarding.UnitTest

private static class StreamDrainerForwarding.UnitTest.Crashes
extends StreamDrainerForwarding

StreamDrainerForwarding subclass which overrides onBytesRead to always throw a RuntimeException.


Nested Class Summary
 
Nested classes/interfaces inherited from class bb.io.StreamDrainerForwarding
StreamDrainerForwarding.UnitTest
 
Constructor Summary
private StreamDrainerForwarding.UnitTest.Crashes(InputStream in, OutputStream out)
           
 
Method Summary
protected  void onBytesRead(byte[] buffer, int numberRead)
          Hook method for the event that bytes were read from StreamDrainerForwarding.in by run.
 
Methods inherited from class bb.io.StreamDrainerForwarding
getBytes, getThrowable, init, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamDrainerForwarding.UnitTest.Crashes

private StreamDrainerForwarding.UnitTest.Crashes(InputStream in,
                                                 OutputStream out)
                                          throws IllegalArgumentException
Throws:
IllegalArgumentException
Method Detail

onBytesRead

protected void onBytesRead(byte[] buffer,
                           int numberRead)
                    throws RuntimeException
Description copied from class: StreamDrainerForwarding
Hook method for the event that bytes were read from StreamDrainerForwarding.in by run. When this method is called, run will have already written those bytes to StreamDrainerForwarding.out. The implementation here does nothing, because writing to out is all that this class does. Subclasses, however, may wish to do additional processing. For example, if the subclass is monitoring some error stream like System.err, then it may wish to do additional error notification.

Overrides:
onBytesRead in class StreamDrainerForwarding
Throws:
RuntimeException