Skip to content

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

@cowtowncoder

Description

@cowtowncoder

(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;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions