Expose the current rate over the maximum lifetime.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 20:31:29 +0000 (22:31 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 10 Apr 2013 20:31:29 +0000 (22:31 +0200)
src/main/java/net/pterodactylus/xdcc/util/io/BandwidthCountingInputStream.java

index 5009cda..444512f 100644 (file)
@@ -64,6 +64,16 @@ public class BandwidthCountingInputStream extends FilterInputStream {
        //
 
        /**
+        * Returns the current rate of this input stream, averaged over the maximum
+        * lifetime of the counter data.
+        *
+        * @return The current rate of this input stream, in bytes/second
+        */
+       public long getCurrentRate() {
+               return accumulatingDataCounter.getCurrentRate();
+       }
+
+       /**
         * Returns the current rate of this input stream, averaged over the given
         * amount of milliseconds.
         *