- CheckedInputStream Class



The class is an input stream that also maintains a checksum of the data being read. The checksum can then be used to verify the integrity of the input data.

Class declaration

Following is the declaration for class −

public class CheckedInputStream
   extends FilterInputStream


Sr.No. Constructor & Description

CheckedInputStream(InputStream in, Checksum cksum)

Creates an input stream using the specified Checksum.

Class methods

Sr.No. Method & Description
1 Checksum getChecksum()

Returns the Checksum for this input stream.

2 int read()

Reads a byte.

3 int read(byte[] buf, int off, int len)

Reads into an array of bytes.

4 long skip(long n)

Skips specified number of bytes of input.

Methods inherited

This class inherits methods from the following classes −

  • java.lang.Object