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 |
chance
protected double chance
min
protected int min
max
protected int max
StallOutputStream
public StallOutputStream(java.io.OutputStream out,
double chance,
int min,
int max)
- Initialize this object.
- Parameters:
out - the output streamchance - the chance for a stall to happen (1.0 = always, 0.0 = never)min - the minimum number of msec per stallmax - the maximum number of msec per stall
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