Class ThrottledInputStream
java.lang.Object
java.io.InputStream
ecmwf.common.technical.ThrottledInputStream
-
Constructor Summary
ConstructorsConstructorDescriptionThrottledInputStream(InputStream inputStream) Instantiates a new throttled input stream.ThrottledInputStream(InputStream inputStream, long maxBytesPerSec) Instantiates a new throttled input stream. -
Method Summary
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
ThrottledInputStream
Instantiates a new throttled input stream.- Parameters:
inputStream- the input stream
-
ThrottledInputStream
Instantiates a new throttled input stream.- Parameters:
inputStream- the input streammaxBytesPerSec- the max bytes per sec
-
-
Method Details
-
close
Close.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
read
Read.- Specified by:
readin classInputStream- Throws:
IOException
-
read
Read.- Overrides:
readin classInputStream- Throws:
IOException
-
read
Read.- Overrides:
readin classInputStream- Throws:
IOException
-
getTotalBytesRead
public long getTotalBytesRead()Gets the total bytes read.- Returns:
- the total bytes read
-
getBytesPerSec
public long getBytesPerSec()Return the number of bytes read per second.- Returns:
- the bytes per sec
-
getTotalSleepTime
public long getTotalSleepTime()Gets the total sleep time.- Returns:
- the total sleep time
-
toString
-