Class ChecksumVerifyingInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.util.zip.CheckedInputStream
-
- org.apache.commons.compress.utils.ChecksumVerifyingInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
CRC32VerifyingInputStream
@Deprecated public class ChecksumVerifyingInputStream extends java.util.zip.CheckedInputStreamDeprecated.UseChecksumInputStream.Verifies the checksum of the data read once the stream is exhausted.- Since:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description ChecksumVerifyingInputStream(java.util.zip.Checksum checksum, java.io.InputStream in, long size, long expectedChecksum)Deprecated.Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description longgetBytesRemaining()Deprecated.Gets the byte count remaining to read.intread()Deprecated.Reads a single byte from the streamintread(byte[] b, int off, int len)Deprecated.Reads from the stream into a byte array.private voidverify()Deprecated.-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset
-
-
-
-
Constructor Detail
-
ChecksumVerifyingInputStream
public ChecksumVerifyingInputStream(java.util.zip.Checksum checksum, java.io.InputStream in, long size, long expectedChecksum)Deprecated.Constructs a new instance.- Parameters:
checksum- Checksum implementation.in- the stream to wrapsize- the of the stream's contentexpectedChecksum- the expected checksum
-
-
Method Detail
-
getBytesRemaining
public long getBytesRemaining()
Deprecated.Gets the byte count remaining to read.- Returns:
- bytes remaining to read.
- Since:
- 1.21
-
read
public int read() throws java.io.IOExceptionDeprecated.Reads a single byte from the stream- Overrides:
readin classjava.util.zip.CheckedInputStream- Throws:
java.io.IOException- if the underlying stream throws or the stream is exhausted and the Checksum doesn't match the expected value
-
read
public int read(byte[] b, int off, int len) throws java.io.IOExceptionDeprecated.Reads from the stream into a byte array.- Overrides:
readin classjava.util.zip.CheckedInputStream- Throws:
java.io.IOException- if the underlying stream throws or the stream is exhausted and the Checksum doesn't match the expected value
-
verify
private void verify() throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
-