alexrintt / shared-storage

Flutter plugin to work with Android external storage.
http://alexrintt.io/shared-storage/
MIT License
53 stars 25 forks source link

High-level features/use-cases research #57

Closed alexrintt closed 1 year ago

alexrintt commented 2 years ago

Note If you want to request some feature, you can include in the issue comments!

To see details, refer to #56.

The following features will be available on the next major release:

EternityForest commented 2 years ago

One thing that I think would definitely be worth having is the ability to append an existing file, and to access a file as a seekable stream without having to copy it all into RAM.

alexrintt commented 2 years ago

@EternityForest Do you have any examples showing how it (seekable stream) works? Would like to see it working.

Also, any further links will be helpful, I'm not aware of this kind of API.

provokateurin commented 2 years ago

@EternityForest Is https://github.com/alexrintt/shared-storage/issues/91 this what you need for a stream based API? I'm not aware of seekable streams in dart, so this is the best you can get I guess.

mx1up commented 1 year ago

I would also love stream support. The stream does not need to be seekable. It is just so I can copy a file to public memory without having to read it fully into memory when using documentFile.writeToFileAsBytes. Ideally, the documentFile.writeToFile would also accept a stream.

For getting the stream, it seems you can follow this recipe (using virtual files): https://developer.android.com/training/data-storage/shared/documents-files#open-virtual-file I have not tried it yet though..

Then wrap it with a dart Stream adapter