Open
Description
🔖 Feature description
Currently, getFileView/Download/Preview return byte arrays.
This will force the user to wait for the whole download to be complete, before he gets a response from the client call.
Also, the whole file will be held in RAM.
Previously, i ran into issues downloading big files: appwrite/sdk-for-android#44
Here are some pros for this feature:
- Reduced Memory Usage:
Streaming allows data to be processed in smaller chunks rather than loading the entire content into memory. - Handling Large Files:
Streaming is particularly useful for handling large files, such as videos or high-resolution images. It allows applications to start playing or displaying content without waiting for the entire file to be downloaded
🎤 Pitch
I see two possible ways to implement this feature:
- Simply replace
ByteArray
withInputStream
-> WILL BREAK COMPATIBILITY - Add three functions, suffixed with "Streamed" for example, enabling users to choose between
ByteArray
andInputStream
without breaking their current implementations." - Make use of generics, allowing the user to specify the return type:
getFileDownload<InputStream>()
(Maybe not possible for every language)
In my case, i added a new function getFileStream
to the Android SDK that returns an InputStream instead of a byte array.
joern-h/sdk-for-android@60d10be
👀 Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct