aboutsummaryrefslogtreecommitdiffstats
path: root/Installer/CountedBufferedInputStream.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2000-12-31 03:35:32 +0000
committerSven Gothel <[email protected]>2000-12-31 03:35:32 +0000
commit85604352f3aef219402a9f502851e71517d268bd (patch)
tree4e2a29e61fd1deb28f370f692a9b805cea9f639f /Installer/CountedBufferedInputStream.java
parent2214e0be5f2e124ebb5c661d0b0efc1191962f2a (diff)
prepared for the Installer 2.06a
Diffstat (limited to 'Installer/CountedBufferedInputStream.java')
-rw-r--r--Installer/CountedBufferedInputStream.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/Installer/CountedBufferedInputStream.java b/Installer/CountedBufferedInputStream.java
new file mode 100644
index 0000000..2d17441
--- /dev/null
+++ b/Installer/CountedBufferedInputStream.java
@@ -0,0 +1,36 @@
+
+import java.io.*;
+
+public class CountedBufferedInputStream extends BufferedInputStream
+{
+ public int totalLen;
+
+ public CountedBufferedInputStream(InputStream in)
+ {
+ super(in);
+ totalLen = 0;
+ }
+
+ public int read() throws IOException
+ {
+ totalLen++;
+ return super.read();
+ }
+
+ public int read(byte[] buf, int a, int b) throws IOException
+ {
+ int c = super.read(buf,a,b);
+ if(c!=-1) totalLen = totalLen+c;
+ return c;
+ }
+
+ public int read(byte[] buf) throws IOException
+ {
+ int c = super.read(buf);
+ if(c!=-1) totalLen += c;
+ return c;
+ }
+
+ public int getReadTotalLen()
+ { return totalLen; }
+}