简体   繁体   中英

Android efficient way to read write segments from a large json file

I'm doing a project where I have to read and write from a large json file and show the content in a list, modify data and save it back.

Currently I'm reading the entire file and serialising it with gson.

Is there an efficient way/library to read/write the data in chunks/pagination and then serialise/deserialise it without loading the entire file in memory?

You may want to look into Streaming API for JSON, be prepared to handle fairly low level details.

Supported by Jackson [0], also looks like streaming is supported by GSON [1]. Potentially useful GSON example [2]


The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM