@@ -0,0 +1,1174 @@
+package myapp.util.zip;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.io.InputStream;%0D%0A%0D%0Aimport myapp.io.FilterInputStream;%0D%0A%0D%0Apublic class CheckedInputStream extends FilterInputStream %7B%0D%0A%0D%0A%09private Checksum cksum;%0D%0A%09%0D%0A%09public CheckedInputStream(InputStream in, Checksum cksum) %7B%0D%0A%09%09super(in);%0D%0A%09%09if (cksum == null) %7B%0D%0A%09%09%09throw new IllegalArgumentException();%0D%0A%09%09%7D%0D%0A%09%09this.cksum = cksum;%0D%0A%09%7D%0D%0A%09%0D%0A%09public Checksum getChecksum() %7B%0D%0A%09%09return cksum;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public int read() throws IOException %7B%0D%0A%09%09byte%5B%5D b = new byte%5B1%5D;%0D%0A%09%09int c = read(b, 0, 1);%0D%0A%09%09if (c %3E 0) %7B%0D%0A%09%09%09return 0xFF & (int)b%5B0%5D; %0D%0A%09%09%7D else %7B%0D%0A%09%09%09return -1;%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public int read(byte%5B%5D b, int off, int len) throws IOException %7B%0D%0A%09%09int tmp = in.read(b, off, len);%0D%0A%09%09if (tmp %3E 0) %7B%0D%0A%09%09%09cksum.update(b, 0, tmp);%0D%0A%09%09%7D%0D%0A%09%09return tmp;%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public long skip(long n) throws IOException %7B%0D%0A%09%09byte%5B%5D b = new byte%5B1024%5D;%0D%0A%09%09long len = n;%0D%0A%09%09int tmp = 0;%0D%0A%09%09while (len %3E 0L) %7B%0D%0A%09%09%09if (len %3E 1024L) %7B%0D%0A%09%09%09%09tmp = read(b);%0D%0A%09%09%09%7D else %7B%0D%0A%09%09%09%09tmp = read(b, 0, (int)len);%0D%0A%09%09%09%7D%0D%0A%09%09%09if (tmp %3E 0) %7B%0D%0A%09%09%09%09len -= (long)tmp;%0D%0A%09%09%09%7D else %7B%0D%0A%09%09%09%09break;%0D%0A%09%09%09%7D%0D%0A%09%09%7D%0D%0A%09%09return n - len;%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

Create CheckedInputStream.java