Skip to content

RealmObject as a byte array #4511

@lbensaad

Description

@lbensaad

Goal

1 - Convert a RealmObject to byte[]
2 - Convert a byte[] to RealmObject

In order to save any ReamlObject to a file I think it should be converted first to a byte[] in internal implementation of Realm. So, is it possible to expose that byte[] to use it in Java,

Expected Results

if a class User extends RealmObject, I want to be able to convert any User object to byte[] and vice versa like this
User user = new User(id,name, email);
byte[] userData = user.toByteArray();
User user2 = new User(userData);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions