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

Fix #2602: Make sure ByteBufferSerializer takes position into account #2603

Merged
merged 1 commit into from
Jan 28, 2020

Conversation

nastra
Copy link

@nastra nastra commented Jan 23, 2020

No description provided.

gen.writeBinary(bbuf.array(), bbuf.arrayOffset(), bbuf.limit());
if (bbuf.hasArray())
{
if (bbuf.position() > 0)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternative option would be:

if (bbuf.hasArray())
{
    if (bbuf.position() > 0)
    {
        bbuf = bbuf.slice();
    }
    gen.writeBinary(bbuf.array(), bbuf.arrayOffset(), bbuf.limit());
    return;
}

@nastra nastra requested a review from cowtowncoder January 23, 2020 14:47
@nastra
Copy link
Author

nastra commented Jan 23, 2020

@cowtowncoder could you review please?

@cowtowncoder cowtowncoder merged commit c6da520 into FasterXML:2.10 Jan 28, 2020
@nastra nastra deleted the 2602 branch January 28, 2020 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants