Class AwsSignedChunkedEncodingInputStream
java.lang.Object
java.io.InputStream
software.amazon.awssdk.core.io.SdkInputStream
software.amazon.awssdk.core.internal.io.AwsChunkedInputStream
software.amazon.awssdk.core.internal.io.AwsChunkedEncodingInputStream
software.amazon.awssdk.auth.signer.internal.chunkedencoding.AwsSignedChunkedEncodingInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Releasable
A wrapper of InputStream that implements chunked encoding.
Each chunk will be buffered for the calculation of the chunk signature
which is added at the head of each chunk. The request signature and the chunk signatures will
be assumed to be hex-encoded strings.
This class will use the mark() invalid input: '&' reset() of the wrapped InputStream if they
are supported, otherwise it will create a buffer for bytes read from
the wrapped stream.
-
Nested Class Summary
-
Field Summary
Fields inherited from class software.amazon.awssdk.core.internal.io.AwsChunkedInputStream
DEFAULT_CHUNK_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
static int
calculateChecksumContentLength
(Algorithm algorithm, String headerName, int signatureLength) static long
calculateStreamContentLength
(long originalLength, int signatureLength, AwsChunkedEncodingConfig config) static long
calculateStreamContentLength
(long originalLength, int signatureLength, AwsChunkedEncodingConfig config, boolean isTrailingChecksumCalculated) Calculates the expected total length of signed payload chunked stream.void
reset()
Reset the stream, either by resetting the wrapped stream or using the buffer created by this class.Methods inherited from class software.amazon.awssdk.core.internal.io.AwsChunkedEncodingInputStream
mark, read
Methods inherited from class software.amazon.awssdk.core.internal.io.AwsChunkedInputStream
markSupported, read, skip
Methods inherited from class software.amazon.awssdk.core.io.SdkInputStream
release
Methods inherited from class java.io.InputStream
available, close, read
-
Method Details
-
builder
-
calculateStreamContentLength
public static long calculateStreamContentLength(long originalLength, int signatureLength, AwsChunkedEncodingConfig config) -
calculateStreamContentLength
public static long calculateStreamContentLength(long originalLength, int signatureLength, AwsChunkedEncodingConfig config, boolean isTrailingChecksumCalculated) Calculates the expected total length of signed payload chunked stream.- Parameters:
originalLength
- The length of the datasignatureLength
- The length of a calculated signature, dependent on whichAwsChunkSigner
is usedconfig
- The chunked encoding config determines the size of the chunks. Use the same values as when initializing the stream.
-
calculateChecksumContentLength
-
reset
Description copied from class:AwsChunkedEncodingInputStream
Reset the stream, either by resetting the wrapped stream or using the buffer created by this class.- Overrides:
reset
in classAwsChunkedEncodingInputStream
- Throws:
IOException
-