jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Jackson JSON Processor
  • JACKSON-287

Add methods in JsonParser, to "push back" buffered but unused content

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.6
  • Component/s: JsonParser
  • Labels:
    None

Description

Jackson JsonParser buffers its input extensively, since this is beneficial for performance. But once read into buffers, there is no way to "push back" content that is not parsed. Being able to do that would be very useful for cases where JSON content is interleaved with other content.

Since there are two kinds of input sources (byte-based like InputStream, character-based like Reader), there need to be two methods, for example:

JsonParser.releaseBufferedInput(OutputStream);
JsonParser.releaseBufferedInput(Writer);

when called for appropriate type, all currently buffered but unused content should be written using given argument.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Tatu Saloranta added a comment - 10/Jun/10 5:40 PM

Additional idea: check whether underlying input comes via PushbackReader or PushbackInputStream; and if so, push unused content back automatically.
Given that this might cause unexpected behavior change, this should only be done if enabled by a new JsonParser.Feature.

Show
Tatu Saloranta added a comment - 10/Jun/10 5:40 PM Additional idea: check whether underlying input comes via PushbackReader or PushbackInputStream; and if so, push unused content back automatically. Given that this might cause unexpected behavior change, this should only be done if enabled by a new JsonParser.Feature.
Hide
Permalink
Tatu Saloranta added a comment - 30/Jul/10 10:41 PM

Added JsonParser.releaseBufferedContent() (Writer, OutputStream).
Did not add explicit support for PushbackOutputStream/Writer at this point (create new issue if requested, easy enough to add, just needs more thought)

Show
Tatu Saloranta added a comment - 30/Jul/10 10:41 PM Added JsonParser.releaseBufferedContent() (Writer, OutputStream). Did not add explicit support for PushbackOutputStream/Writer at this point (create new issue if requested, easy enough to add, just needs more thought)

People

  • Assignee:
    Tatu Saloranta
    Reporter:
    Tatu Saloranta
Vote (0)
Watch (0)

Dates

  • Created:
    29/Apr/10 11:58 PM
    Updated:
    30/Sep/10 1:33 PM
    Resolved:
    30/Jul/10 10:41 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.