I want to allow the user to create a backup of the Realm database. This is already perfectly possible with writeCopyTo() and writeEncryptedCopyTo(). Due to the new file access limitations in Android 10/11 I am forced to use the Storage Access Framework (SAF). Because of this I cannot provide an instance of java.io.File but a java.io.OutputStream.
Describe the solution you'd like
I would like to have an overload of writeCopyTo() and writeEncryptedCopyTo() that takes java.io.OutputStream as parameter.
Additional context
To be fair, it is currently possible to work around this issue by creating a copy in internal storage with the existing methods, and to move this copy to external storage via InputStream and OutputStream. But this adds a lot of overhead.
Describe your problem or use case
I want to allow the user to create a backup of the Realm database. This is already perfectly possible with
writeCopyTo()
andwriteEncryptedCopyTo()
. Due to the new file access limitations in Android 10/11 I am forced to use the Storage Access Framework (SAF). Because of this I cannot provide an instance ofjava.io.File
but ajava.io.OutputStream
.Describe the solution you'd like
I would like to have an overload of
writeCopyTo()
andwriteEncryptedCopyTo()
that takesjava.io.OutputStream
as parameter.Additional context
To be fair, it is currently possible to work around this issue by creating a copy in internal storage with the existing methods, and to move this copy to external storage via InputStream and OutputStream. But this adds a lot of overhead.