Package io.bdeploy.common.util
Class ReportingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
io.bdeploy.common.util.ReportingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
An input stream that reports how many bytes have been read and that calculates the transfer rate.
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionReportingInputStream(InputStream in, long bytesTotal, ActivityReporter.Activity activity, String activityName) Creates a new input stream that reports progress when reading from the given stream. -
Method Summary
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skipMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
ReportingInputStream
public ReportingInputStream(InputStream in, long bytesTotal, ActivityReporter.Activity activity, String activityName) Creates a new input stream that reports progress when reading from the given stream.- Parameters:
in- the input stream to read frombytesTotal- the total amount of bytes to readactivity- activity reporteractivityName- the name of the activity to show
-
-
Method Details
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-