How can I send a multipart request using a byte stream?
TL;DR: Is there a FormData.addByteStream(Stream<Uint8List>) API?
I've got a large file (5GB+) and I need to upload to a server using a multipart request. Uno has FormData.addBytes() which allow appending bytes to the form body, but eventually crash the app with a OutOfMemoryError since I'm just appending bytes¹ to the object.
The theoretical solution I thought would be to provide the byte stream to Uno package so the package can send the Multipart request packets gradually (as the bytes load). By using this approach the chunk(N) of bytes is garbage collected soon as possible to load the next chunk(N+1) of bytes without overloading the memory because the chunk(N) was already freed-up.
Also, the Uno package would be able to .pause and .resume the byte flow as their will using the StreamSubscription<Uint8List> API.
If you have got any other ideas on how to handle this scenario (large file upload + multipart request), would be really helpful.
A detail I forgot: I've no access to File or any other IO instances, its only their byte stream and length, that's all.