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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the underlying stream and validates the calculated checksum against the expected.Methods inherited from class software.amazon.awssdk.core.io.SdkFilterInputStream
available, mark, markSupported, read, read, release, reset, skip
Methods 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classSdkFilterInputStream
- Throws:
Crc32MismatchException
- If the calculated CRC32 checksum does not match the expected.IOException
-