X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fxdcc%2Futil%2Fio%2FBandwidthCountingInputStream.java;h=444512fbfd0e54b8ecbe64c2b66c83846e23e4fa;hb=b60fced6d70d1bcc6f0854b6a8d34bd094883692;hp=5009cda50e5cf1b0219329c2cc73eaa9500d01f2;hpb=9b7afa0998062127271320893951dfded32cc22a;p=xudocci.git 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. *