I need to download a huge PDF file from an URL in my MonoTouch iPhone/iPad newsstand app.
The PDF is too big to fit in memory, so I need to save it incrementally with NSData.
My idea is the following: instead of appending all the downloaded data in NSData and at the very end of the download, when I got all data, to store it to a file, I want to execute the download asynchronously in a separate thread and append to a file each received chunk and free my memory, but be certain that if the connection is dropped or the app crashes the download would resume automatically from the last chunk without corrupting the file.
What do you suggest? Is there a better method? How can I do it in MonoTouch? I did't find any documentation or code example about iOS incremental download/resume on the Xamarin website.