jfreerails.util
Class FlowRateOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
jfreerails.util.FlowRateOutputStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.Runnable
public class FlowRateOutputStream
- extends java.io.FilterOutputStream
- implements java.lang.Runnable
A FilterOutputStream that measures flow rate.
- Author:
- Patrice Espie Licensing: LGPL
| Fields inherited from class java.io.FilterOutputStream |
out |
| Methods inherited from class java.io.FilterOutputStream |
flush |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private static final java.util.logging.Logger logger
byteSent
private long[] byteSent
byteSentCumul
private long byteSentCumul
totalByteSent
private long totalByteSent
previousTotalByteSent
private long previousTotalByteSent
openTimeMillis
private long openTimeMillis
measureIntervall
private long measureIntervall
nextFree
private int nextFree
nbUsed
private int nbUsed
running
private boolean running
closeRequested
private boolean closeRequested
streamName
private java.lang.String streamName
showTrace
private boolean showTrace
decimalFormat
private java.text.DecimalFormat decimalFormat
FlowRateOutputStream
public FlowRateOutputStream(java.io.OutputStream out,
java.lang.String streamName)
FlowRateOutputStream
public FlowRateOutputStream(java.io.OutputStream out,
java.lang.String streamName,
int measureDuration,
int measureInterval)
FlowRateOutputStream
public FlowRateOutputStream(java.io.OutputStream out)
close
public void close()
throws java.io.IOException
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.FilterOutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
write in class java.io.FilterOutputStream
- Throws:
java.io.IOException
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
write in class java.io.FilterOutputStream
- Throws:
java.io.IOException
write
public void write(int b)
throws java.io.IOException
- Overrides:
write in class java.io.FilterOutputStream
- Throws:
java.io.IOException
currentRate
public int currentRate()
throws java.io.IOException
- Throws:
java.io.IOException
overallRate
public int overallRate()
throws java.io.IOException
- Throws:
java.io.IOException
overallRateString
public java.lang.String overallRateString()
throws java.io.IOException
- Throws:
java.io.IOException
currentRateString
public java.lang.String currentRateString()
run
public void run()
- Specified by:
run in interface java.lang.Runnable