I am reading data from an API feed and saving the chunks into files. When the files reach 2 MB I start a new file and write to that file. What happens now is that an entry can get cut off at the end of a file and continues into the new file. I try and reconstruct the files by taking the last entry and combining it with the first entry but this is tedious and was wondering if anyone had a better suggestion on handling the data transmission and file creation.