Fix issue where the incorrect buffers are written (#27695)
This is a followup to #27551. That commit introduced a bug where the incorrect byte buffers would be returned when we attempted a write. This commit fixes the logic.
This commit is contained in:
parent
6c7374804f
commit
5b3230cbae
|
@ -81,9 +81,9 @@ public class WriteOperation {
|
|||
|
||||
ByteBuffer[] postIndexBuffers = new ByteBuffer[buffers.length - offsetIndex];
|
||||
|
||||
ByteBuffer firstBuffer = buffers[0].duplicate();
|
||||
ByteBuffer firstBuffer = buffers[offsetIndex].duplicate();
|
||||
firstBuffer.position(internalIndex - offsets[offsetIndex]);
|
||||
postIndexBuffers[offsetIndex] = firstBuffer;
|
||||
postIndexBuffers[0] = firstBuffer;
|
||||
int j = 1;
|
||||
for (int i = (offsetIndex + 1); i < buffers.length; ++i) {
|
||||
postIndexBuffers[j++] = buffers[i].duplicate();
|
||||
|
|
Loading…
Reference in New Issue