FileDocCategorySizeDatePackage
CheckedInputStream.javaAPI DocExample934Tue Dec 12 18:57:40 GMT 2000None

CheckedInputStream

public class CheckedInputStream extends FilterInputStream

Fields Summary
private Checksum
cksum
Constructors Summary
public CheckedInputStream(InputStream in, Checksum cksum)

        super(in);
        this.cksum = cksum;
    
Methods Summary
public ChecksumgetChecksum()

        return cksum;
    
public intread()

        int b = in.read();
        if (b != -1) {
            cksum.update(b);
        }
        return b;
    
public intread(byte[] b)

        int len;
        len = in.read(b, 0, b.length);
        if (len != -1) {
            cksum.update(b, 0, len);
        }
        return len;
    
public intread(byte[] b, int off, int len)

        len = in.read(b, off, len);
        if (len != -1) {
            cksum.update(b, off, len);
        }
        return len;