public class ChecksumVerifyingInputStream extends InputStream
| Constructor and Description |
|---|
ChecksumVerifyingInputStream(Checksum checksum,
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) |
available, mark, markSupported, resetpublic ChecksumVerifyingInputStream(Checksum checksum, 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 IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic long getBytesRemaining()
public int read() throws IOException
read in class InputStreamIOException - if the underlying stream throws or the
stream is exhausted and the Checksum doesn't match the expected
valuepublic int read(byte[] b) throws IOException
read in class InputStreamIOException - 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 IOException
read in class InputStreamIOException - if the underlying stream throws or the
stream is exhausted and the Checksum doesn't match the expected
valuepublic long skip(long n) throws IOException
skip in class InputStreamIOExceptionCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.