CheckedInputStreampublic 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 Checksum | getChecksum()
return cksum;
| public int | read()
int b = in.read();
if (b != -1) {
cksum.update(b);
}
return b;
| public int | read(byte[] b)
int len;
len = in.read(b, 0, b.length);
if (len != -1) {
cksum.update(b, 0, len);
}
return len;
| public int | read(byte[] b, int off, int len)
len = in.read(b, off, len);
if (len != -1) {
cksum.update(b, off, len);
}
return len;
|
|