Why DefaultMappedFile::appendMessageInner() call ByteBuffer::position() after ByteBuffer::slice() #6698
Unanswered
yao-wenbin
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The code looks like this:
In my opinion, the slice() methods will return the new Rerecence of ByteBuffer with position is 0, and limit is remainning size.
And then The call to position() will resets current to the original ByteBuffer's position(which is currentPos) and starts writing, so isn't the space between the new ByteBuffer's 0 and currentPos wasted
Beta Was this translation helpful? Give feedback.
All reactions