Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not rewind position when serializing direct ByteBuffer #4164

Merged
merged 2 commits into from Oct 17, 2023

Conversation

yawkat
Copy link
Member

@yawkat yawkat commented Oct 17, 2023

ByteBufferSerializer considers the position when serializing heap buffers, but ignores it (by rewinding) for direct buffers. I believe the former behavior is correct, so I've aligned the direct buffer code with that.

This might be better for 2.17, I don't know.

testByteBuffer was broken by this change because it didn't flip the buffer after writing.

ByteBufferSerializer considers the position when serializing heap buffers, but ignores it (by rewinding) for direct buffers. I believe the former behavior is correct, so I've aligned the direct buffer code with that.

This might be better for 2.17, I don't know.
@cowtowncoder cowtowncoder added the 2.16 Issues planned for 2.16 label Oct 17, 2023
@cowtowncoder cowtowncoder changed the title Consider position when serializing direct ByteBuffer Do not rewind position when serializing direct ByteBuffer Oct 17, 2023
@cowtowncoder
Copy link
Member

Makes sense to me: thank you @yawkat.

And while there is some risk here, I think this belongs in 2.16 since we are pre-release-candidate phase.
So will merge in.

@cowtowncoder cowtowncoder merged commit 1126dff into FasterXML:2.16 Oct 17, 2023
3 checks passed
cowtowncoder added a commit that referenced this pull request Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.16 Issues planned for 2.16
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants