Hi Jitu,I verified on GlassFish, without closing the JsonWriter, the contents are written in HTTP response. It works for both character stream and byte stream. I will check-in the app to the workspace.
thanks for your comments.
I'm using 1.0.4-SNAPSHOT but I have to pull latest changes.
In (not only) my opinion JsonWriter should be extending also Flushable interface (in addition to (Auto)Closable). This is the cleanest and most obvious solution - workarounds proposed are ugly and should not apply for this newly developed JSONP API. I know that this is a modification of a public API but I'm not sure this API is already approved or it's still under development. Even if it's approved it could be a patch or (1.0.1 release :)
Please note that all the other solution proposed either by me or you are implementation dependent. This small change in API makes it flexible and available for all possible implementations.
I will open a JIRA issue beg next week.
Have a nice weekend!
Re: JsonWriter is missing flush() method