jakartaee / jsonp-api

Jakarta JSON Processing
https://eclipse.org/ee4j/jsonp
Other
138 stars 59 forks source link

InputStream Json rendering #392

Open s5bug opened 1 year ago

s5bug commented 1 year ago

Related to #300

Would be a lot easier to supply Json to various things if one could generate an InputStream from a JsonValue. Right now the only way to do it is with PipedOutputStream, which means one either has to sacrifice control over threads to get the writing done asynchronously or do no better than holding the whole Json string in memory.

A pull-based interface for Json serialization, i.e. one that exposes creating an InputStream, would work around having to figure out Flow.Publisher (the other Java-y way of solving this problem) which is unnecessarily difficult to implement correctly.