I have an android app to read room database and export it to json. It spend memory very much. I just wanna use stream or any other solution so that it doesn't need to load entire data in memory. Current code read the entire data from room, convert it to json string and write it in file and it seems not efficient. Anybody who have an experience please help me.