Class ChunkContentUtils
java.lang.Object
software.amazon.awssdk.core.internal.util.ChunkContentUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longcalculateChecksumTrailerLength(Algorithm algorithm, String headerName) Calculates the content length for a given algorithm and header name.static longcalculateChunkLength(long originalContentLength) The chunk format is: chunk-size CRLF chunk-data CRLF.static longcalculateStreamContentLength(long originalLength, long chunkSize) Calculates the content length for data that is divided into chunks.static ByteBuffercreateChecksumTrailer(String computedChecksum, String trailerHeader) Creates Chunk encoded checksum trailer for a computedChecksum which is in Base64 encoded.static ByteBuffercreateChunk(ByteBuffer chunkData, boolean isLastByte) Creates ChunkEncoded data for an given chunk data.
-
Field Details
-
HEADER_COLON_SEPARATOR
- See Also:
-
ZERO_BYTE
- See Also:
-
CRLF
- See Also:
-
LAST_CHUNK
- See Also:
-
LAST_CHUNK_LEN
public static final long LAST_CHUNK_LEN
-
-
Method Details
-
calculateChunkLength
public static long calculateChunkLength(long originalContentLength) The chunk format is: chunk-size CRLF chunk-data CRLF.- Parameters:
originalContentLength- Original Content length.- Returns:
- the length of this chunk
-
calculateStreamContentLength
public static long calculateStreamContentLength(long originalLength, long chunkSize) Calculates the content length for data that is divided into chunks.- Parameters:
originalLength- original content length.chunkSize- chunk size- Returns:
- Content length of the trailer that will be appended at the end.
-
calculateChecksumTrailerLength
-
createChecksumTrailer
Creates Chunk encoded checksum trailer for a computedChecksum which is in Base64 encoded.- Parameters:
computedChecksum- Base64 encoded computed checksum.trailerHeader- Header for the checksum data in the trailer.- Returns:
- Chunk encoded checksum trailer with given header.
-
createChunk
Creates ChunkEncoded data for an given chunk data.- Parameters:
chunkData- chunk data that needs to be converted to chunk encoded format.isLastByte- if true then additional CRLF will not be appended.- Returns:
- Chunk encoded format of a given data.
-