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

Add 'JsonGenerator.writeString(Reader r, int charLength)' #17

Closed
cowtowncoder opened this issue May 27, 2012 · 7 comments
Closed

Add 'JsonGenerator.writeString(Reader r, int charLength)' #17

cowtowncoder opened this issue May 27, 2012 · 7 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

Current 'writeString()' method requires text value to be passed in its entirety. This may not work well with larger payloads; so we should an alternative method where one can define source for text, used for incremental/streaming read+write.
In addition to Reader, it should be possible to indicate exact number of bytes to include; this because some formats (not JSON however!) require such information to be written before data, or used for initializing write. It should be possible to pass marker value -1 to indicate "not known": not all generators are required to support it, however.

If length is indicated, it is an error for Reader to provide less data (more is ok; generator just will not read anything beyond indicated amount).

@terziele
Copy link

terziele commented Aug 8, 2016

#309

@cowtowncoder
Copy link
Member Author

Thank you for contributing this! I hope to look into it soon, but at this point I have bit of a backlog with issues so it may take couple of days. But I wanted to add a note to know I am aware of this PR.

@cowtowncoder
Copy link
Member Author

Another quick note: I plan on merging this after 2.8.2 gets released, and I can change master to be `2.9.0-SNAPSHOT``. At that point adding new features is possible, and this can go in. Thank you for your patience!

uhhhh2 added a commit to uhhhh2/jackson-core that referenced this issue Feb 9, 2017
@uhhhh2
Copy link
Contributor

uhhhh2 commented Feb 9, 2017

I have an idea for a fix at https://github.com/uhhhh2/jackson-core . How does it look so far? Where would be a good place to create a unit test?

@cowtowncoder
Copy link
Member Author

@uhhhh2 Please create a PR if you have a solution that you think works.

@uhhhh2
Copy link
Contributor

uhhhh2 commented Feb 10, 2017

#353

cowtowncoder added a commit that referenced this issue Feb 23, 2017
Alternate approach for issue #17
@cowtowncoder cowtowncoder added this to the 2.9.0 milestone Feb 23, 2017
@cowtowncoder cowtowncoder changed the title add 'writeString(Reader r, int charLength)' method in JsonGenerator Add 'JsonGenerator.writeString(Reader r, int charLength)' Feb 23, 2017
@cowtowncoder
Copy link
Member Author

Merged, to be included in 2.9.0.

@uhhhh2 Thank you contributing this!

cowtowncoder added a commit that referenced this issue Feb 23, 2017
…impl, causes unnecessary compatibility issues
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

3 participants