...
1 FlatBuffers
2===========
3
4
5[](https://buildkite.com/bazel/flatbuffers)
6[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:flatbuffers)
7[](https://api.securityscorecards.dev/projects/github.com/google/flatbuffers)
8[](https://gitter.im/google/flatbuffers?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
9[](https:///discord.gg/6qgKs3R)
10[](https://twitter.com/wvo)
11[](https://twitter.com/dbaileychess)
12
13
14**FlatBuffers** is a cross platform serialization library architected for
15maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.
16
17## Quick Start
18
191. Build the compiler for flatbuffers (`flatc`)
20
21 Use `cmake` to create the build files for your platform and then perform the compliation (Linux example).
22
23 ```
24 cmake -G "Unix Makefiles"
25 make -j
26 ```
27
282. Define your flatbuffer schema (`.fbs`)
29
30 Write the [schema](https://flatbuffers.dev/flatbuffers_guide_writing_schema.html) to define the data you want to serialize. See [monster.fbs](https://github.com/google/flatbuffers/blob/master/samples/monster.fbs) for an example.
31
323. Generate code for your language(s)
33
34 Use the `flatc` compiler to take your schema and generate language-specific code:
35
36 ```
37 ./flatc --cpp --rust monster.fbs
38 ```
39
40 Which generates `monster_generated.h` and `monster_generated.rs` files.
41
424. Serialize data
43
44 Use the generated code, as well as the `FlatBufferBuilder` to construct your serialized buffer. ([`C++` example](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.cpp#L24-L56))
45
465. Transmit/store/save Buffer
47
48 Use your serialized buffer however you want. Send it to someone, save it for later, etc...
49
506. Read the data
51
52 Use the generated accessors to read the data from the serialized buffer.
53
54 It doesn't need to be the same language/schema version, FlatBuffers ensures the data is readable across languages and schema versions. See the [`Rust` example](https://github.com/google/flatbuffers/blob/master/samples/sample_binary.rs#L92-L106) reading the data written by `C++`.
55
56## Documentation
57
58**Go to our [landing page][] to browse our documentation.**
59
60## Supported operating systems
61- Windows
62- macOS
63- Linux
64- Android
65- And any others with a recent C++ compiler (C++ 11 and newer)
66
67## Supported programming languages
68
69Code generation and runtime libraries for many popular languages.
70
711. C
721. C++ - [snapcraft.io](https://snapcraft.io/flatbuffers)
731. C# - [nuget.org](https://www.nuget.org/packages/Google.FlatBuffers)
741. Dart - [pub.dev](https://pub.dev/packages/flat_buffers)
751. Go - [go.dev](https://pkg.go.dev/github.com/google/flatbuffers)
761. Java - [Maven](https://search.maven.org/artifact/com.google.flatbuffers/flatbuffers-java)
771. JavaScript - [NPM](https://www.npmjs.com/package/flatbuffers)
781. Kotlin
791. Lobster
801. Lua
811. PHP
821. Python - [PyPI](https://pypi.org/project/flatbuffers/)
831. Rust - [crates.io](https://crates.io/crates/flatbuffers)
841. Swift - [swiftpackageindex](https://swiftpackageindex.com/google/flatbuffers)
851. TypeScript - [NPM](https://www.npmjs.com/package/flatbuffers)
861. Nim
87
88## Versioning
89
90FlatBuffers does not follow traditional SemVer versioning (see [rationale](https://github.com/google/flatbuffers/wiki/Versioning)) but rather uses a format of the date of the release.
91
92## Contribution
93
94* [FlatBuffers Issues Tracker][] to submit an issue.
95* [stackoverflow.com][] with [`flatbuffers` tag][] for any questions regarding FlatBuffers.
96
97*To contribute to this project,* see [CONTRIBUTING][].
98
99## Community
100
101* [FlatBuffers Google Group][] to discuss FlatBuffers with other developers and users.
102* [Discord Server](https:///discord.gg/6qgKs3R)
103* [Gitter](https://gitter.im/google/flatbuffers)
104
105
106## Security
107
108Please see our [Security Policy](SECURITY.md) for reporting vulnerabilities.
109
110## Licensing
111*Flatbuffers* is licensed under the Apache License, Version 2.0. See [LICENSE][] for the full license text.
112
113<br>
114
115 [CONTRIBUTING]: http://github.com/google/flatbuffers/blob/master/CONTRIBUTING.md
116 [`flatbuffers` tag]: https://stackoverflow.com/questions/tagged/flatbuffers
117 [FlatBuffers Google Group]: https://groups.google.com/forum/#!forum/flatbuffers
118 [FlatBuffers Issues Tracker]: http://github.com/google/flatbuffers/issues
119 [stackoverflow.com]: http://stackoverflow.com/search?q=flatbuffers
120 [landing page]: https://google.github.io/flatbuffers
121 [LICENSE]: https://github.com/google/flatbuffers/blob/master/LICENSE
View as plain text