Skip to content

ytkang/flatbuffers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forked from google/flatbuffers

Goal

Use "--force-defaults" option to emit default values into final bytes. Table Start function will add all default values into builder.

Supported Languages

  • Java/C#
  • Golang

Example

flatc -g -n packet.fbs --force-defaults

// packet.fbs
namespace packet;

table Packet {
  id:uint16=1234;
}

Packet.go

...
func PacketStart(builder *flatbuffers.Builder) {
	builder.StartObject(1)
	builder.PrependUint16Slot(0, 1234, 0)
}
...

Packet.cs

...
public static void StartPacket(FlatBufferBuilder builder) {
	builder.StartTable(1);
	builder.AddUshort(0, 1234, 0);
  }
...

will be generated.

About

FlatBuffers: Memory Efficient Serialization Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 45.3%
  • Java 8.9%
  • C# 7.3%
  • Rust 6.7%
  • Python 5.4%
  • Dart 5.1%
  • Other 21.3%