Class ChecksumCalculatingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.compress.utils.ChecksumCalculatingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Calculates the checksum of the data read.
- Since:
- 1.14
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, resetMethods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
ChecksumCalculatingInputStream
-
-
Method Details
-
getValue
public long getValue()Returns the calculated checksum.- Returns:
- the calculated checksum.
-
read
Reads a single byte from the stream- Overrides:
readin classFilterInputStream- Throws:
IOException- if the underlying stream throws or the stream is exhausted and the Checksum doesn't match the expected value
-
read
Reads from the stream into a byte array.- Overrides:
readin classFilterInputStream- Throws:
IOException- if the underlying stream throws or the stream is exhausted and the Checksum doesn't match the expected value
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-