protocol-buffers

Using GPB, how do I make my wrapper classes stop accepting binary messages that aren't meant for them?

I'm using Google Protocol Buffers to serialize some of my business objects (in a Java app). As recommended in the tutorials, I wrap the message builder in a class of my own that implements getter and setter methods to access the message's properties. Also, I declared all message fields optional, again following their recommendations. No...

How does protobuf-net achieve respectable performance?

I want to understand why the protocol buffers solution for .NET developed by Marc Gravell is as fast as it is. I can understand how the original Google solution achieved its performance: it pre-generates optimized code for object serialization; I've written some serialization by hand and know that it is possible to write pretty fast co...

Android and Protocol Buffers

I am writing an Android application that would both store data and communicate with a server using protocol buffers. However, the stock implementation of protocol buffers compiled with the LITE flag (in both the JAR library and the generated .java files) has an overhead of ~30 KB, where the program itself is only ~30 KB. In other words, ...

Google Go integration with Protocol Buffers?

After a quick look at the documentation, I immediately started to think about integration with existing languages and applications and was wondering whether support would be provided for Protocol Buffers? ...

Google Protocol Buffer repeated field C++

I have the below protocol buffer. Note that StockStatic is a repeated field. message ServiceResponse { enum Type { REQUEST_FAILED = 1; STOCK_STATIC_SNAPSHOT = 2; } message StockStaticSnapshot { repeated StockStatic stock_static = 1; } required Type type = 1; optional StockStati...

Any example with Protocol Buffers + GWT?

Do you know about any example using together Google Protocol Buffers and GWT? ...

Using Protocol buffer as general Data object?

We're introducing protocol buffers as the new transport for some back end RPC services. Because there's resistance to manually shuttling data between different forms of similar objects, I can forsee the Protocol Buffer instances being passed up the stack a bit higher than just to the RPC server interface. Is this something that I shoul...

Why do I see "cannot import name descriptor_pb2" error when using Google Protocol Buffers?

When using the generated Python code from our protobuf classes, we get this error: cannot import name descriptor_pb2 The equivalent C++ generated code works just fine, so it would appear that there is no problem with our actual proto definitions. This error occurs when I try and import our class, like so: import sys sys.path.append(...

Using an RPC like Protocol Buffers as a backend to Django, instead of MySQL or SQLite

The clever folks behind the app-engine-patch project have essentially enabled all the fun stuff of Django, including the admin, but without using Django's ORM. From their website: The most important change is that you have to use Google's Model class because the development model is too different from Django (at least with Django's ...

How to use protocol buffers ?

Hi , Could someone please help and tell me how to use protocol buffers. Actually I want to exchange data through sockets between a program running on unix and anoother running on windows in order to run simulation studies. The programs that use sockets to exchange data, are written in C/C++ and I would be glad if somneone could help ...

Serializing a List of objects using Protobuf-net

I've been looking to do some binary serialization to file and protobuf-net seems like a well-performing alternative. I'm a bit stuck in getting started though. Since I want to decouple the definition of the classes from the actual serialization I'm not using attributes but opting to go with .proto files, I've got the structure for the ob...

Should I use a binary or a text file for storing protobuf messages?

Using Google protobuf, I am saving my serialized messaged data to a file - in each file there are several messages. We have both C++ and Python versions of the code, so I need to use protobuf functions that are available in both languages. I have experimented with using SerializeToArray and SerializeAsString and there seems to be the fol...

Using Python, how do I get a binary serialization of my Google protobuf message?

I see the function SerializeAsString in the protobuf Python documentation, but like this suggests, this gives me a string version of the binary data. Is there a way of serializing and parsing a binary array of protobuf data using Python? We have a C++ application that stores the protobuf messages as binary data in a file. We'd like to r...

How do I read binary C++ protobuf data using Python protobuf?

The Python version of Google protobuf gives us only: SerializeAsString() Where as the C++ version gives us both: SerializeToArray(...) SerializeAsString() We're writing to our C++ file in binary format, and we'd like to keep it this way. That said, is there a way of reading the binary data into Python and parsing it as if it were a...

How to write these classes using Google's protobuf?

I have just come accross Google's Protocol buffers. It seems to be the solution for a C++ backend application I am writing. Problem is I cant seem to find anything regarding vector types. The documentation mentions repeated_types, but I cant seem to find anything. Supposing I have these set of classes: class UnifiedBinaryHeader { publi...

Performance penalty of getSerializedSize() in Protocol Buffers

Is there a performance penalty for calling getSerializedSize() on a GPB message before serializing the message with writeTo(OutputStream)? I need to be able to know the size of a message before writing it to an output stream. I'm using GPB on Java. ...

protobuf-net communicating with C++

I'm looking at protobuf-net for implementing various messaging formats, and I particularly like the contract-based approach as I don't have to mess with the proto compiler. one thing I couldn't quite find information on is, does this make it difficult to work cross-platform? there are a few C++ apps that would need to be able to parse PB...

How to get structure of a Google Protobuf message without the definition

I have to get the message structure of a protobuf message transfered to me without the message's definition. Using UnknownFieldSet methods, I was able to get a string representation of the message as below: 1: "a" 2: { 3:"b" 4:"c" } What data structure does field 2 represent ? Using UnknownFieldSet.Field.getGroupList i was able ...

Protocol Buffers versus JSON or BSON

Does anyone have any information on the performance characteristics of Protocol Buffers versus BSON (binary JSON) or versus JSON in general? Wire size Serialization speed Deserialization speed These seem like good binary protocols for use over HTTP. I'm just wondering which would be better in the long run for a C# environment. Here...

How to use Python and Google's Protocol Buffers to deserialize data sent over TCP

I'm trying to write an application which uses Google's protocol buffers to deserialize data (sent from another application using protocol buffers) over a TCP connection. The problem is that it looks as if protocol buffers in Python can only deserialize data from a string. Since TCP doesn't have well-defined message boundaries and one o...