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:
write
in classOutputStream
- Throws:
IOException
-
write
Write.- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
Write.- Overrides:
write
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-