Firebase 数据库以字节数组形式获取值

Firebase Database get value as byte array

我想知道 Firebase SDK 中是否有办法将值作为字节数组数据获取。为什么?好吧,我想将 flatbuffers 实现为 serialization/deserialization 机制。

Firebase Realtime Database本质上是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用来将二进制数据转化为字符串格式,但在这个过程中会变大

另请记住:如果您这样做,您的数据基本上是不可搜索的,而且是人类不可读的。