Class ChunkBuffer
- java.lang.Object
-
- software.amazon.awssdk.core.internal.async.ChunkBuffer
-
public final class ChunkBuffer extends Object
Class that will buffer incoming BufferBytes to chunks of bufferSize. If totalBytes is not provided, i.e. content-length is unknown,getBufferedData()should be used in the Subscriber'sonComplete()to check for a final chunk that is smaller than the chunk size, and send if present.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceChunkBuffer.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ChunkBuffer.Builderbuilder()Optional<ByteBuffer>getBufferedData()Retrieve the current buffered data.Iterable<ByteBuffer>split(ByteBuffer inputByteBuffer)Split the inputByteBufferinto multiple smallerByteBuffers, each of which containschunkSizeworth of bytes.
-
-
-
Method Detail
-
builder
public static ChunkBuffer.Builder builder()
-
split
public Iterable<ByteBuffer> split(ByteBuffer inputByteBuffer)
Split the inputByteBufferinto multiple smallerByteBuffers, each of which containschunkSizeworth of bytes. If the last chunk of the input ByteBuffer contains less thanchunkSizedata, the last chunk will be buffered.
-
getBufferedData
public Optional<ByteBuffer> getBufferedData()
Retrieve the current buffered data.
-
-