Class ChunkContentUtils
java.lang.Object
software.amazon.awssdk.core.internal.util.ChunkContentUtils
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
calculateChecksumTrailerLength
(Algorithm algorithm, String headerName) Calculates the content length for a given algorithm and header name.static long
calculateChunkLength
(long originalContentLength) The chunk format is: chunk-size CRLF chunk-data CRLF.static long
calculateStreamContentLength
(long originalLength, long chunkSize) Calculates the content length for data that is divided into chunks.static ByteBuffer
createChecksumTrailer
(String computedChecksum, String trailerHeader) Creates Chunk encoded checksum trailer for a computedChecksum which is in Base64 encoded.static ByteBuffer
createChunk
(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
Calculates the content length for a given algorithm and header name.- Parameters:
algorithm
- Algorithm used.headerName
- Header name.- Returns:
- Content length of the trailer that will be appended at the end.
-
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.
-