jfreerails.util
Class FlowRateInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
jfreerails.util.FlowRateInputStream
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Runnable
public class FlowRateInputStream
- extends java.io.FilterInputStream
- implements java.lang.Runnable
A FilterInputStream that measures flow rate.
- Author:
- Patrice Espie Licensing: LGPL
| Fields inherited from class java.io.FilterInputStream |
in |
| Methods inherited from class java.io.FilterInputStream |
available, mark, markSupported, reset, skip |
| 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
byteReceived
private long[] byteReceived
byteReceivedCumul
private long byteReceivedCumul
totalByteReceived
private long totalByteReceived
previousTotalByteReceived
private long previousTotalByteReceived
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
FlowRateInputStream
public FlowRateInputStream(java.io.InputStream in,
java.lang.String streamName)
FlowRateInputStream
public FlowRateInputStream(java.io.InputStream in,
java.lang.String streamName,
int measureDuration,
int measureInterval)
FlowRateInputStream
public FlowRateInputStream(java.io.InputStream in)
close
public void close()
throws java.io.IOException
- Specified by:
close in interface java.io.Closeable- Overrides:
close in class java.io.FilterInputStream
- Throws:
java.io.IOException
read
public int read()
throws java.io.IOException
- Overrides:
read in class java.io.FilterInputStream
- Throws:
java.io.IOException
read
public int read(byte[] b)
throws java.io.IOException
- Overrides:
read in class java.io.FilterInputStream
- Throws:
java.io.IOException
read
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
- Overrides:
read in class java.io.FilterInputStream
- Throws:
java.io.IOException
currentRate
public int currentRate()
currentRateString
public java.lang.String currentRateString()
overallRate
public int overallRate()
run
public void run()
- Specified by:
run in interface java.lang.Runnable