Skip to content

Reading and Building FlatBuffers

Maxim Zaks edited this page Jan 23, 2016 · 3 revisions

In the article FlatBuffers Explained I described how data is stored as binary array. And that there is lots of byte hopping involved when it comes to reading FlatBuffers.

All the infrastructure we need to read values out of of a binary array is defined in FlatBufferReader.swift file.

It's logical contra part is FlatBufferBuilder.swift file.

It contains all the logic we needed to write values into a binary array.

Although those two classes are enough to build and read FlatBuffers I would not recommend using them directly.

In the article Code Generation I will explain how to generate Swift classes out of FlatBuffer Schema. And read and build FlatBuffers through a very comfortable API.

If you are curious how to use FlatBufferBuilder and FlatBufferReader stand alone. Have a look at FlatBuffers Unit Tests.

Clone this wiki locally