Class ThrottledOutputStream
java.lang.Object
java.io.OutputStream
ecmwf.common.technical.ThrottledOutputStream
-
Constructor Summary
ConstructorsConstructorDescriptionThrottledOutputStream(OutputStream outputStream) Instantiates a new throttled output stream.ThrottledOutputStream(OutputStream outputStream, long maxBytesPerSecond) Instantiates a new throttled output stream. -
Method Summary
Methods inherited from class java.io.OutputStream
flush, nullOutputStream
-
Constructor Details
-
ThrottledOutputStream
Instantiates a new throttled output stream.- Parameters:
outputStream- the output stream
-
ThrottledOutputStream
Instantiates a new throttled output stream.- Parameters:
outputStream- the output streammaxBytesPerSecond- the max bytes per second
-
-
Method Details
-
write
Write.- Specified by:
writein classOutputStream- Throws:
IOException
-
write
Write.- Overrides:
writein classOutputStream- Throws:
IOException
-
write
Write.- Overrides:
writein classOutputStream- Throws:
IOException
-
throttle
Throttle.- Throws:
IOException- Signals that an I/O exception has occurred.
-
getBytesPerSec
public long getBytesPerSec()Return the number of bytes read per second.- Returns:
- the bytes per sec
-
toString
-
close
Close.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-