Skip to content

Add new method like JsonParser.readText(Writer) (and implementation) for truly non-buffering reads #1288

@cowtowncoder

Description

@cowtowncoder

(note: off-shoot of FasterXML/jackson#221)
(note: was earlier filed as #15, mea culpa)

Currently there is no way to access contents of long JSON String values without buffering of all contents in memory: even metho

JsonParser.getText(Writer)

will temporarily buffer contents in TextBuffer (but avoids construction of big String unlike getText()).
But it would be possible and desirable to have an alternative that would decode and provide content without buffering; similar to how Stax2-compliant XML parsers (Aalto, Woodstox) do it.

Semantic difference would be that such method, f.ex

JsonParser.readText(Writer)

would read, pass and consume contents, such that after call finishes, parser now points to the end of text value, and text value could no longer be read.
Because of this change, we cannot change implementation of existing getText(Writer)

I will also update Javadocs of getText(Writer) to indicate use of buffering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceIssue related to performance problems or enhancements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions