I am trying to read a Json file (which contains a `JsonArray`) in `Amazon S3` using `Gson`, add extra 2 fields to every `JsonObject`, add the `JsonObject`s into a `JsonArray` and write the `JsonArray` back to a file.
Below is how the .json file I am reading looks like.
Below is my code, trying to do everything explained above
As you can see, I need to generate a .json file after 100 `JsonObjects` are collected. But my code generate invalid Json. It simply generate the following Json for the above code.
As you can see, it is invalid and it does not have 100 `JsonObject`s. What have I done wrong here? Please help. It is invalid because it does not close the JsonObject and JsonArray properly with brackets.
Is there no one in SO to help this problem?
PS: Please note that I made this question in
here as well, but I did not get any valuable answer.>