play-json icon indicating copy to clipboard operation
play-json copied to clipboard

[Feature] Support writing JsValue directly to OutputStream

Open here-abarany opened this issue 1 year ago • 0 comments

When writing JSON data from the Scala framework with JVM, you currently only have options to convert the JsValue instances to a string or byte array. However, if you have a particularly large JSON file, this can cause a large memory spike as it needs to buffer the whole file in memory before dumping to disk. Ideally there should be a function on the JSON facade object to expose writing a JsValue to an OutputStream, which could call the the writeValue() overload on Jackson's ObjectMapper that takes an OutputStream.

here-abarany avatar Feb 14 '25 01:02 here-abarany