0

My JSON will be as follows:

{
"id" : "1",
"data" : "aaaaaaaaaaaaaaaaaaaaa"
}

I am ready to use any JSON Parser. But I want the data element as InputStream.

Could you please me to implement the same in Java?

user1862354
  • 117
  • 11
  • Normally, I used to create simple value objects and map the stream to the simple value object. But in this case, the value of "data " will be more than 10 MB...So i want the "data" as input stream – user1862354 Mar 30 '21 at 07:05

1 Answers1

0

Use GSON or JSON from maven Repository it's simple to use and nice , If you need to create test project use JSON library and if you need to use for heavy Json or Parse to Object use GSON library. if you need to write JSON to file that's not about json library , if you need to read json format from input stream in this case both of them can help you. check this question : Convert InputStream to JSONObject