Purple Code

com.purpletech.io
Class StallOutputStream

java.lang.Object
  |
  +--java.io.OutputStream
        |
        +--java.io.FilterOutputStream
              |
              +--com.purpletech.io.StallOutputStream

public class StallOutputStream
extends java.io.FilterOutputStream

stupid useless class -- stalls after writing random number of bytes

Version:
VERSIONDATA
Author:
AUTHORNAME

Field Summary
protected  double chance
           
protected  int max
           
protected  int min
           
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
StallOutputStream(java.io.OutputStream out, double chance, int min, int max)
          Initialize this object.
 
Method Summary
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
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
 

Field Detail

chance

protected double chance

min

protected int min

max

protected int max
Constructor Detail

StallOutputStream

public StallOutputStream(java.io.OutputStream out,
                         double chance,
                         int min,
                         int max)
Initialize this object.

Parameters:
out - the output stream
chance - the chance for a stall to happen (1.0 = always, 0.0 = never)
min - the minimum number of msec per stall
max - the maximum number of msec per stall
Method Detail

write

public void write(int b)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
java.io.IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
java.io.IOException

Documentation generated March 5 2003