play-json
play-json copied to clipboard
[Feature] Support writing JsValue directly to OutputStream
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.