java.util.zip.CheckedInputStream (JDK 1.1)
This class is a subclass of java.io.FilterInputStream; it allows a stream to be read and a checksum computed on its contents at the same time. This is useful when you want to check the integrity of a stream of data against a published checksum value.
To create a CheckedInputStream, you must specify both the stream that it should read and also a Checksum object, such as CRC32, that implements the particular checksum algorithm you desire. The read() and skip() methods are the same as those of other input streams. As bytes are read, they are incorporated into the checksum that is being computed. Note that the getChecksum() method does not return the checksum value itself, but rather the Checksum object. You must call the getValue() method of this object to obtain the checksum value.
public classCheckedInputStreamextends FilterInputStream { //Public ConstructorpublicCheckedInputStream(InputStreamin, Checksumcksum); //Public Instance Methodspublic ChecksumgetChecksum(); public intread() throws IOException; //Overrides FilterInputStreampublic intread(byte[]buf, intoff, intlen) throws IOException; //Overrides FilterInputStreampublic longskip(longn) throws IOException; //Overrides FilterInputStream}
Hierarchy:
Object->InputStream->FilterInputStream->CheckedInputStream