Class MonitoredInputStream

java.lang.Object
java.io.InputStream
net.targetr.wtm3.io.MonitoredInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class MonitoredInputStream extends InputStream
Keeps track of how many bytes are read from an input stream.

Used for statistical purposes.

Author:
Dr Michael Gardiner
  • Constructor Details

    • MonitoredInputStream

      public MonitoredInputStream(InputStream in, AtomicLong counter)
      Decorates a stream with the ability to monitor how much data is transferred.
      Parameters:
      in - The input stream to monitor.
      counter - The counter that should be incremented.
  • Method Details