Firebase Database get value as byte array

2.1k Views Asked by At

I was wondering if there's a way in the Firebase SDK to get the value as byte array data. Why? Well I want to implement flatbuffers as a serialization/deserialization mechanism.

1

There are 1 best solutions below

1
On BEST ANSWER

Firebase Realtime Database is essentially structured as a JSON document. JSON doesn't have a native representation for arbitrary binary data. If you need to store arbitrary binary data, you'll need to get that data into a format compatible with JSON. Traditionally, base64 encoding is used to get binary data into string format, but it becomes larger in the process.

Bear in mind also: if you do this, your data is essentially unsearchable and humanly unreadable.