From: David ‘Bombe’ Roden Date: Wed, 10 Apr 2013 20:31:29 +0000 (+0200) Subject: Expose the current rate over the maximum lifetime. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=099e3500a7357ee556aaad819e06e7180ec29db0;p=xudocci.git Expose the current rate over the maximum lifetime. --- diff --git a/src/main/java/net/pterodactylus/xdcc/util/io/BandwidthCountingInputStream.java b/src/main/java/net/pterodactylus/xdcc/util/io/BandwidthCountingInputStream.java index 5009cda..444512f 100644 --- a/src/main/java/net/pterodactylus/xdcc/util/io/BandwidthCountingInputStream.java +++ b/src/main/java/net/pterodactylus/xdcc/util/io/BandwidthCountingInputStream.java @@ -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. *