Skip to content

Conversation

@mkurz
Copy link
Member

@mkurz mkurz commented Nov 11, 2025

Re-opening #1127 (I pushed to that branch but GitHub closed it and I can not re-open it anymore).

/cc @here-abarany

Added JsonFacade functions writeToStream and prettyPrintToStream to support
writing to an OutputStream without first writing the full string to memory.
The JVM implementation forwards these calls to the appropriate functions in
Jackson.

For now, the non-JVM implementations will build up the full string in
memory. Ideally the strings should be written out as they are built up, but
this would require a refactoring of the fromJs() function to support an
interface to feed each string value and minimize the number of conversions
to UTF-8 (for toBytes and writing to stream) or avoid conversions (for
String). For now, this fulfills the interface guarantee while providing the
same level of functionality as before.

Fixes playframework#1126
Copy link
Member Author

@mkurz mkurz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mkurz mkurz merged commit 0b73c45 into playframework:main Nov 11, 2025
14 checks passed
@mkurz mkurz deleted the main_here-abarny branch November 11, 2025 14:11
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

Successfully merging this pull request may close these issues.

2 participants