public class ChecksumVerifyingInputStream
extends java.io.InputStream
Constructor and Description |
---|
ChecksumVerifyingInputStream(java.util.zip.Checksum checksum,
java.io.InputStream in,
long size,
long expectedChecksum)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
long |
getBytesRemaining() |
int |
read()
Reads a single byte from the stream
|
int |
read(byte[] b)
Reads a byte array from the stream
|
int |
read(byte[] b,
int off,
int len)
Reads from the stream into a byte array.
|
long |
skip(long n) |
public ChecksumVerifyingInputStream(java.util.zip.Checksum checksum, java.io.InputStream in, long size, long expectedChecksum)
checksum
- Checksum implementation.in
- the stream to wrapsize
- the of the stream's contentexpectedChecksum
- the expected checksumpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public long getBytesRemaining()
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- if the underlying stream throws or the
stream is exhausted and the Checksum doesn't match the expected
valuepublic int read(byte[] b) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- if the underlying stream throws or the
stream is exhausted and the Checksum doesn't match the expected
valuepublic int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
- if the underlying stream throws or the
stream is exhausted and the Checksum doesn't match the expected
valuepublic long skip(long n) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
Copyright © 2010 - 2023 Adobe. All Rights Reserved