I'm trying to write/read a json object to/from a file. The json structure is complex and is dynamically generated.
For small json object I would just transform json to string then do string writing/reading. This causes out of memory issue when the json gets too large.
How do I stream the JSONObject directly to a file, and stream back the JSONObject directly from the file?