Skip to the content.

Protocol buffers

Protocol buffers are Google’s language-neutral, platform-neutral, extensible mechansim for serializing structured data. It’s faster and simpler. It has support for C++, C#, DART, GO, JAVA, PYTHON.

Let’s work with a simple example.

syntax = "proto2"
package example;

message ImageFile{

  required string filename = 1;
  required string filepath = 2;
  optional string absoltuepath = 3;

  message Size{

    required int height = 1;
    required int width = 2;

  }

}