Package com.adobe.testing.s3mock.util
Class AwsChunkedDecodingChecksumInputStream
java.lang.Object
java.io.InputStream
com.adobe.testing.s3mock.util.AbstractAwsInputStream
com.adobe.testing.s3mock.util.AwsChunkedDecodingChecksumInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Merges chunks from AWS chunked AwsChunkedEncodingInputStream, skipping V4 style signing metadata.
The checksum is optionally included in the stream as part of the "trail headers"
after the last chunk.
The original stream looks like this:
24;chunk-signature=312a41de690364ad6d17629d1e026c448e78abd328f1602276fdd2c3f928d100 ## sample test file ## demo=content 0;chunk-signature=4d2b448448f29b473beb81340f5a3d6c9468e4fbb9ac761cfab63846919011fb x-amz-checksum-sha256:1VcEifAruhjVvjzul4sC0B1EmlUdzqvsp6BP0KSVdTE=
The format of each chunk of data is:
[hex-encoded-number-of-bytes-in-chunk];chunk-signature=[sha256-signature][EOL] [payload-bytes-of-this-chunk][EOL]
The format of the full payload is:
[hex-encoded-number-of-bytes-in-chunk];chunk-signature=[sha256-signature][EOL] [payload-bytes-of-this-chunk][EOL] 0;chunk-signature=[sha256-signature][EOL] x-amz-checksum-[checksum-algorithm]:[checksum][EOL] [other trail headers]
- See Also:
-
Field Summary
Fields inherited from class com.adobe.testing.s3mock.util.AbstractAwsInputStream
algorithm, checksum, CHECKSUM_HEADER, chunkLength, chunks, CRLF, decodedLength, DELIMITER, readDecodedLength, source -
Constructor Summary
ConstructorsConstructorDescriptionAwsChunkedDecodingChecksumInputStream(InputStream source, long decodedLength) -
Method Summary
Methods inherited from class com.adobe.testing.s3mock.util.AbstractAwsInputStream
close, endsWith, extractAlgorithmAndChecksum, getAlgorithm, getChecksum, readUntil, setChunkLengthMethods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Constructor Details
-
AwsChunkedDecodingChecksumInputStream
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-