Class Crc32ChecksumValidatingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
software.amazon.awssdk.core.io.SdkFilterInputStream
software.amazon.awssdk.core.internal.util.Crc32ChecksumValidatingInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable,Releasable
Wraps the provided input stream with a
Crc32ChecksumCalculatingInputStream and after the stream is closed
will validate the calculated checksum against the actual checksum.-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class software.amazon.awssdk.core.io.SdkFilterInputStream
available, mark, markSupported, release, reset, skipMethods inherited from class java.io.FilterInputStream
read
-
Constructor Details
-
Crc32ChecksumValidatingInputStream
- Parameters:
in- Input stream to content.expectedChecksum- Expected CRC32 checksum returned by the service.
-
-
Method Details
-
close
Closes the underlying stream and validates the calculated checksum against the expected.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classSdkFilterInputStream- Throws:
Crc32MismatchException- If the calculated CRC32 checksum does not match the expected.IOException
-
read
- Overrides:
readin classSdkFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classSdkFilterInputStream- Throws:
IOException
-