Author: toad
Date: 2008-02-15 15:20:44 +0000 (Fri, 15 Feb 2008)
New Revision: 17943
Modified:
trunk/freenet/src/freenet/support/io/CountedInputStream.java
Log:
Implement read(byte[])
Modified: trunk/freenet/src/freenet/support/io/CountedInputStream.java
===================================================================
--- trunk/freenet/src/freenet/support/io/CountedInputStream.java
2008-02-15 15:11:29 UTC (rev 17942)
+++ trunk/freenet/src/freenet/support/io/CountedInputStream.java
2008-02-15 15:20:44 UTC (rev 17943)
@@ -29,6 +29,13 @@
return ret;
}
+ public int read(byte[] buf) throws IOException {
+ int ret = super.read(buf);
+ if (ret != -1)
+ count += ret;
+ return ret;
+ }
+
public long skip(long n) throws IOException {
long l = in.skip(n);
if(l > 0) count += l;