I was wondering if there is a way to convert the contents of a byte[] variable into a XML variable, for example, I download a file asynchronously into a byte[] variable and then I want to read it as an XML file.
Is there a straightforward way to do this, or do I have to first save it and then read as XML or maybe create a function to download the file asynchronously already as an XML file?
I know I can use
requestImage() to download an image from an URL asynchronously, but I was wondering if there was a way to download a file (not limited to being an image) in an asynchronous way.
Also, on side note, is there a way to check for the size of the file to download and how much is already downloaded? Or to check if there even is an internet connection?
I am working on a project that relies on input files (images and others). I want the program to first check if the files are present on the computer and if they aren't I want it to download them. Images are easy to download and display, but if I want to save them to the PC how can I do it? I am familiar with the save() function but it saves everything on screen, I just want to save that PImage variable's content. How can I go about doing this?