Yeah, if you ever see (const void*, size_t size) as the parameter, you gotta convert whatever data you’re dealing with into a MemoryBlock first and then mb.getData(), mb.getSize() as the args. And use those stream methods that write to and read from a MemoryBlock
Yea the thought with trying to use the InputStream from the file was to conserve on memory. With the memory block, I’m copying the file contents into a memory buffer, then when I convert it to Base64 and put it into a String, then i’m pretty much making another copy of that and storing that in memory also. Finally, I stuff it into a URL object (where it possibly gets copied again?), so a 50mb file might take up to 150mb of memory?
Maybe I should call mb.reset() right after I convert it to a Base64 string.
If you use the scope pointer and create them on the stack you don’t have to worry about any of that because when the function exits, it’ll deconstruct them automatically