Class ChecksumInputStream
- java.lang.Object
- 
- java.io.InputStream
- 
- java.io.FilterInputStream
- 
- com.oracle.bmc.objectstorage.transfer.internal.ChecksumInputStream
 
 
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable
 
 public class ChecksumInputStream extends FilterInputStream A ChecksumInputStream that computes and verifies a checksum for the data read from the stream.Supports CRC32C, SHA-256, SHA-384, and MD5 algorithms. Checksum verification is performed before the last byte is read. If the computed checksum does not match the expected checksum, an IOException is thrown. 
- 
- 
Field Summary- 
Fields inherited from class java.io.FilterInputStreamin
 
- 
 - 
Constructor SummaryConstructors Constructor Description ChecksumInputStream(InputStream in, ChecksumAlgorithm algorithm, String expectedChecksum, long contentLength)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intread()intread(byte[] b)intread(byte[] b, int off, int len)longskip(long n)This method throws an IOException because the underlying stream classesRetryingStreamandMultithreadStreamdo not support the skip operation.- 
Methods inherited from class java.io.FilterInputStreamavailable, close, mark, markSupported, reset
 - 
Methods inherited from class java.io.InputStreamnullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
 
- 
 
- 
- 
- 
Constructor Detail- 
ChecksumInputStreampublic ChecksumInputStream(InputStream in, ChecksumAlgorithm algorithm, String expectedChecksum, long contentLength) throws NoSuchAlgorithmException - Throws:
- NoSuchAlgorithmException
 
 
- 
 - 
Method Detail- 
readpublic int read() throws IOException- Overrides:
- readin class- FilterInputStream
- Throws:
- IOException
 
 - 
readpublic int read(byte[] b, int off, int len) throws IOException- Overrides:
- readin class- FilterInputStream
- Throws:
- IOException
 
 - 
readpublic int read(byte[] b) throws IOException- Overrides:
- readin class- FilterInputStream
- Throws:
- IOException
 
 - 
skippublic long skip(long n) throws IOExceptionThis method throws an IOException because the underlying stream classesRetryingStreamandMultithreadStreamdo not support the skip operation.- Overrides:
- skipin class- FilterInputStream
- Throws:
- IOException
 
 
- 
 
-