santosh gore
santosh gore

Reputation: 329

How to convert JsonArray from Gson to stream

We are using JsonArray from Gson instead of JSONArray. So, we are facing issue to convert JsonArray to parallelStream. How to do that?

Upvotes: 10

Views: 4593

Answers (1)

Michał Ziober
Michał Ziober

Reputation: 38655

Try:

Stream<JsonElement> stream = StreamSupport.stream(jsonArray.spliterator(), true);

Upvotes: 20

Related Questions