Skip to content

Commit

Permalink
clear buffer instead of setting limit
Browse files Browse the repository at this point in the history
  • Loading branch information
hg-ms committed Oct 7, 2024
1 parent 1b50233 commit 263a5df
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ private ByteBuffer ensureReadingBuffer(final int fileLength)
this.stringReadBuffer = new byte[fileLength];
}

this.directByteBuffer.limit(fileLength);
this.directByteBuffer.clear();

return this.directByteBuffer;
}

private ArrayView<ByteBuffer> ensureWritingBuffer(final byte[] bytes)
{
this.ensureBufferCapacity(bytes.length);
this.directByteBuffer.limit(bytes.length);
this.directByteBuffer.clear();

this.stringWriteBuffer = bytes;

Expand Down

0 comments on commit 263a5df

Please sign in to comment.