users@jsonb-spec.java.net

[jsonb-spec users] [jsr367-experts] Re: Appendable/Readable vs Writer/Reader

From: Romain Manni-Bucau <rmannibucau_at_tomitribe.com>
Date: Wed, 13 Jan 2016 15:12:32 +0100

In Johnzon we wrap them if we don't know the type (isInstance()) otherwise
we just cast them which means in practise - "real life" - we'll almost
never use the wrapper but we don't prevent the user to rely on it if
needed. Why not doing the same in the RI? It allows few more input/output
which can be nice for some usages (not runtime but one time init or test
ones).


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau

2016-01-13 15:07 GMT+01:00 <dmitry.kornilov_at_oracle.com>:

> Hi,
>
> During our work on RI we realised that using Appendable / Readable in
> Jsonb.toJson/fromJson methods is not convenient.
>
> We are using JSONP as a parser. JSONP uses java.io.Writer and
> java.io.Reader instead of Appendable and Readable. It means that we
> need to wrap Appendable/Readable parameters to Writer/Reader before
> passing it to JSONP. Such a wrap appears redundant to me. It’s also not
> a best solution from the performance point of view.
>
> I am suggesting replacing Appendable/Readable in JSONB to Writer and
> Reader as it is in JSONP unless there is a strong reason to leave it as
> it is now.
>
> Thanks,
> Dmitry