Compact Framework Language: C # FrameWork 3.5
I have a client (pocket PC) and I want to send data to web service REST (https connection). I need to upload large files of several megabytes and then I have multiple connections by dividing the file into chunks. I do:
byte[] formData = new byte[...];
formDataStream.Read(formData, 0, (int) formDataStream.Length);
There is a parameter in the compact framework that tells me what is the maximum size that I can allocate in formData according to the device in use? If yes, what library could I use to get this parameter? In this way I could split the file in chunks of default size.
There is no library that can tell you what the largest array you can allocate is because that number is not fixed. It depends on the available memory and heap fragmentation on the device at the exact time you want to make the allocation. Your best bet is to just pick a reasonable size based on your typical device state, I'd probably pick 64k, and then try "tuning" it from there to see what gives you the best performance.