Add support for `Realm.writeCopyTo()/writeEncryptedCopyTo()`

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Local
    • None

      Similar to Realm Java we should expose the option of writing copies of Realm files. This enables multiple features

      • Make it easy to  create backups
      • Encrypt a non-encrypted Realm
      • Create asset files that can be bundled in Android APK's

       

      // No proper filesystem support in Kotlin stdlib, use Strings or expose okio Paths?
      Realm.writeCopyTo(destination: String)
      Realm.writeEncryptedCopyTo(destination: String, key: ByteArray)

       

      Note, that in order to support new Android 11 security mechanisms on external storage, we might want to expose a variant on Android that returns an outputbuffer. See https://github.com/realm/realm-java/issues/6974  

       

            Assignee:
            Christian Melchior (Inactive)
            Reporter:
            Christian Melchior (Inactive)
            Archiver:
            Marc Greenfield

              Created:
              Updated:
              Resolved:
              Archived: