Questions tagged [protocol-buffers]

For questions about Google's protocol buffers

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.

https://developers.google.com/protocol-buffers

7638 questions
4
votes
1 answer

when ParseFromArray return true in protocol buffer

I ParseFromArray the protocol buffer's protocol, the protocol is not lack any filed. But the ParseFromArray function returns false. Why?
user2231794
  • 51
  • 1
  • 1
  • 5
4
votes
1 answer

Google::protobuf + boost::asio failure

I have studied the existing examples: Sending Protobuf Messages with boost::asio Reading Protobuf objects using boost::asio::read_async Google Protocol Buffers: parseDelimitedFrom and writeDelimitedTo for C++ Are there C++ equivalents for the…
Vitaly Isaev
  • 5,392
  • 6
  • 45
  • 64
4
votes
1 answer

Timeout problems with the Riak Python Client with protocol buffers

I'm seeing a strange but consistent behaviour from the Python Riak Client when connecting to my riak AWS cluster using protocol buffers. This short python snippet produces the error: import time import riak client = riak.RiakClient( …
4
votes
1 answer

Google Protocol Buffers and UTF-16

I have an application that stores data in UTF-16 (mainly because the of the Chinese/Big-5 characters). It uses Google Protocol Buffers for the request/response protocol. I realize you can't send UTF-16 data back in the string format. I was trying…
user2884282
  • 59
  • 1
  • 5
4
votes
1 answer

if .proto file keeps un-changed, is data exchanged-able between different protobuf versions?

let's say the .proto files never changes, and we have a client -server system based on TCP, they speak each otehr via protobuf message. Before both client and server is on protobuf version 2.4.1. Now server upgrades to 2.5.0 (first recompile .java…
hongdiao
  • 39
  • 1
4
votes
2 answers

Replace String Enum with protobuf auto generated Enum

My Enum original java code is: public enum CarModel { NOMODEL("NOMODEL"); X("X"), XS("XS"), XSI("XS-I"); //NOTE the special - character. Can't be declared XS-I XSI2("XS-I.2"); //NOTE the special . character. Can't be declared…
Dror Cohen
  • 6,731
  • 5
  • 29
  • 32
4
votes
2 answers

Example of using "byte" datatype with protobuf-c

I'm trying to use protobuf-c in a c-project to transfer some data. The examples for the "string" and the "byte" datatype are missing here Can anyone provide a small example for those? My problem is that I don't know how to allocate memory for a…
Robert Buhren
  • 86
  • 1
  • 1
  • 4
4
votes
7 answers

Common C pattern, but expressed in C++?

A common pattern in C programming involves a variable length structure such as: typedef struct { int length; char data[1]; } MyBuffer; where data isn't literally an array of [1]. Instead, its variable length is defined by length. The…
abelenky
  • 63,815
  • 23
  • 109
  • 159
4
votes
3 answers

Where is the (meta) .proto file which describes .desc files?

Where is the (meta) .proto file which describes .desc files? I make .desc files with: protoc --descriptor_set_out=foo.desc --include_imports foo.proto Am I correct in believing that the .desc files are in protobuf format? If so, where can I get…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
4
votes
1 answer

Specifying Google Cloud Endpoints Response protocol

I it possible to specify the output protocol of the Response when creating a method with cloud endpoints? I would like to use a protobuf instead of json.
4
votes
2 answers

C++ serialization library that supports partial serialization?

Are there any good existing C++ serialization libraries that support partial serialization? By "partial serialization" I mean that I might want to save the values of 3 specific members, and later be able to apply that saved copy to a different…
Joseph Garvin
  • 20,727
  • 18
  • 94
  • 165
4
votes
3 answers

How to print enum names instead of int value of a protocol buffer (Java)

The default toString prints the int value instead of the enum name. Is there an easy way to make it print the enum name instead?
Raymond Ho
  • 41
  • 1
  • 1
  • 3
4
votes
1 answer

Transform protobuf to avro

I have data serialized in protobuff format and I want to transform it to an Avro serialization. I have no problem reading the proto data using ProtoTest.Msg msg = buildMessage(); ProtobufData protobufData = ProtobufData.get(); Schema…
user882447
  • 41
  • 1
  • 4
4
votes
1 answer

what's the storage format of protobuf data?

the .proto file: package lm; message helloworld { required int32 id = 1; required string str = 2; optional int32 opt = 3; } the writer.cc file: #include #include #include "lm.helloworld.pb.h" #include…
nzomkxia
  • 1,219
  • 4
  • 16
  • 35
4
votes
1 answer

protobuf maven 3 protoc plugin error

in my pom.xml I have following google protobuf plugin declaration: com.google.protobuf.tools maven-protoc-plugin 0.3.1
alexanoid
  • 24,051
  • 54
  • 210
  • 410