CheckedInputStream 

Introduction

The java.util.zip.CheckedInputStream 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 java.util.zip.CheckedInputStream class −

publicclassCheckedInputStreamextendsFilterInputStream

Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career.

Constructors

Sr.No.Constructor & Description
1CheckedInputStream(InputStream in, Checksum cksum)Creates an input stream using the specified Checksum.

Class Methods

Sr.No.Method & Description
1Checksum getChecksum()Returns the Checksum for this input stream.
2int read()Reads a byte.
3int read(byte[] buf, int off, int len)Reads into an array of bytes.
4long skip(long n)Skips specified number of bytes of input.

Methods Inherited

This class inherits methods from the following classes −

  • java.io.FilterInputStream
  • java.lang.Object

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *