public class ChecksumValidatingInputStream extends InputStream
| Constructor and Description |
|---|
ChecksumValidatingInputStream(InputStream inputStream,
SdkChecksum sdkChecksum,
String expectedChecksum)
Creates an input stream using the specified Checksum, input stream, and length.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort() |
void |
close() |
int |
read()
Reads from the underlying stream.
|
int |
read(byte[] buf,
int off,
int len)
Reads up to len bytes at a time from the input stream, updates the checksum.
|
void |
reset()
Resets stream state, including the running checksum.
|
available, mark, markSupported, read, skippublic ChecksumValidatingInputStream(InputStream inputStream, SdkChecksum sdkChecksum, String expectedChecksum)
inputStream - the input streamsdkChecksum - the Checksum implementationexpectedChecksum - the checksum value as seen un .public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] buf,
int off,
int len)
throws IOException
read in class InputStreambuf - buffer to write intooff - offset in the buffer to write tolen - maximum number of bytes to attempt to read.IOExceptionpublic void reset()
throws IOException
reset in class InputStreamIOExceptionpublic void abort()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionCopyright © 2023. All rights reserved.