Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ public Flux<BufferAggregator> write(ByteBuffer buf) {
// We will overflow the current buffer and require another one.
// Duplicate and adjust the window of buf so that we fill up currentBuf without going out of bounds.
ByteBuffer duplicate = buf.duplicate();
duplicate.limit(buf.position() + (int) this.currentBuf.remainingCapacity());
int newLimit = buf.position() + (int) this.currentBuf.remainingCapacity();
duplicate.limit(newLimit);
this.currentBuf.append(duplicate);
// Adjust the window of original buffer to represent remaining part.
buf.position(buf.position() + (int) this.currentBuf.remainingCapacity());
buf.position(newLimit);

result = Flux.just(this.currentBuf);

Expand Down