Please, take into consideration that people who work with XML today may
consider migrating to Json. For that, they need an API that is rich enough to
deal with the problems they have. Therefore, they will probably miss the
flush() method because you can find this method in the XML Stream API
(http://docs.oracle.com/javase/7/docs/api/javax/xml/stream/XMLStreamWriter.html)
There are algorithms out there that need it.

The equivalent XMLStreamWriter is JsonGenerator in the API. It
implements Flushable interface.
JsonWriter is for writing already created object models. If the single
write method already writes the entire contents, then I don't see any
need for explicit flush() method.

I’m sure you can find it in many other APIs, so Jsonp cannot fall behind for
so long.

On 01 Nov 2013, at 00:36, Jitendra Kotamraju
<
>
wrote:

On 10/31/13 12:17 PM, Jitendra Kotamraju wrote:

That should have worked esp when you are creating JsonWriter using a i/o
Writer. JsonWriter.write() method writes all the contents to underlying
writer. The recent releases don't use BufferedWriter. Are you using the
latest version i.e. 1.3 or 1.4-SNAPSHOT ?

But if you create JsonWriter with byte stream, then that doesn't work.
Internally, it uses

I fixed this for byte streams also. So, JsonWriter#write methods would write
all the buffered contents to given output source.