jakartaee/jsonp-api

InputStream Json rendering

s5bug opened this issue · 0 comments

s5bug commented

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.