Class ReportingInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
io.bdeploy.common.util.ReportingInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class ReportingInputStream extends FilterInputStream
An input stream that reports how many bytes have been read and that calculates the transfer rate.
  • 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 from
      bytesTotal - the total amount of bytes to read
      activity - activity reporter
      activityName - the name of the activity to show
  • Method Details