users@jsonp.java.net

Re: JsonWriter is missing flush() method

From: Hildeberto Mendonça <hildeberto_at_yougi.org>
Date: Fri, 1 Nov 2013 09:02:36 +0100

Hi Jitu,

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.

Even Json for .net has it (http://james.newtonking.com/json/help/index.html?topic=html/AllMembers_T_Newtonsoft_Json_JsonWriter.htm) so you can not neglect it, because it just have to be there, period.

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 <jitendra.kotamraju_at_oracle.com> 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.
>