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

Implement UTF8JsonGenerator.writeRawValue(SerializableString) (and writeRaw(..)) more efficiently #484

Closed
cowtowncoder opened this issue Oct 4, 2018 · 0 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

(note: follow-up for #480)

Current implementation is:

    public void writeRawValue(SerializableString text) throws IOException {
        _verifyValueWrite(WRITE_RAW);
        byte[] raw = text.asUnquotedUTF8();
        if (raw.length > 0) {
            _writeBytes(raw);
        }
    }

but latter part should be implemented as something like:

        int len = name.appendUnquotedUTF8(_outputBuffer, _outputTail);
        if (len < 0) {
            _writeBytes(name.asUnquotedUTF8());
        } else {
            _outputTail += len;
        }
@cowtowncoder cowtowncoder changed the title Implement UTF8JsonGenerator.writeRawValue(SerializableString) more efficiently Implement UTF8JsonGenerator.writeRawValue(SerializableString) (and writeRaw(..)) more efficiently Oct 4, 2018
@cowtowncoder cowtowncoder modified the milestones: 2.10, 2.10.0 Oct 8, 2018
cowtowncoder added a commit that referenced this issue Oct 8, 2018
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

No branches or pull requests

1 participant