Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File extension for serialized protobuf output

Seems odd that I can't find the answer to this, but what file extension are you supposed to use when storing serialized protobuf output in a file? Just .protobuf? The json equivalent of what I am talking about would be a .json file.

like image 556
Nick Avatar asked Jun 15 '17 22:06

Nick


People also ask

What format is protobuf?

Protocol buffers, or Protobuf, is a binary format created by Google to serialize data between different services. Google made this protocol open source and now it provides support, out of the box, to the most common languages, like JavaScript, Java, C#, Ruby and others.

What are protobuf files?

Protocol buffers are a combination of the definition language (created in . proto files), the code that the proto compiler generates to interface with data, language-specific runtime libraries, and the serialization format for data that is written to a file (or sent across a network connection).

What is .proto file in Java?

proto file. The definitions in a . proto file are simple: you add a message for each data structure you want to serialize, then specify a name and a type for each field in the message. Here is the . proto file that defines your messages, addressbook.

How do I view a .proto file?

If you cannot open your PROTO file correctly, try to right-click or long-press the file. Then click "Open with" and choose an application. You can also display a PROTO file directly in the browser: Just drag the file onto this browser window and drop it.


1 Answers

I just use .bin, but there's no actual standard here AFAIK. If protoc -o (which emits a .proto schema in protobuf binary format as a FileDescriptorSet) had taken a directory like all the other output options do, we could have used that as a de-facto answer, but protoc -o is unusual in that it takes a file instead. In an old post on the protobuf group, Kenton Varda (one of the original authors) suggests that the file extension should be implementation specific (meaning: you decide) rather than simply referring to the format: https://groups.google.com/forum/#!topic/protobuf/JWZx9n8CUvw

like image 120
Marc Gravell Avatar answered Sep 18 '22 08:09

Marc Gravell