public final class ChunkBuffer extends Object
getBufferedData()
should be used in the Subscriber's
onComplete()
to check for a final chunk that is smaller than the chunk size, and send if present.Modifier and Type | Class and Description |
---|---|
static interface |
ChunkBuffer.Builder |
Modifier and Type | Method and Description |
---|---|
static ChunkBuffer.Builder |
builder() |
Optional<ByteBuffer> |
getBufferedData()
Retrieve the current buffered data.
|
Iterable<ByteBuffer> |
split(ByteBuffer inputByteBuffer)
Split the input
ByteBuffer into multiple smaller ByteBuffer s, each of which contains chunkSize
worth of bytes. |
public static ChunkBuffer.Builder builder()
public Iterable<ByteBuffer> split(ByteBuffer inputByteBuffer)
ByteBuffer
into multiple smaller ByteBuffer
s, each of which contains chunkSize
worth of bytes. If the last chunk of the input ByteBuffer contains less than chunkSize
data, the last chunk will
be buffered.public Optional<ByteBuffer> getBufferedData()
Copyright © 2023. All rights reserved.