Questions tagged [protostuff]

Protostuff is the stuff that leverages google's protobuf.

A serialization library with built-in support for forward-backward compatibility (schema evolution) and validation.

Protocol Buffers file parser and code generator.

web-site: http://www.protostuff.io/

source: https://github.com/protostuff/protostuff

43 questions
1
vote
0 answers

Netty Protostuff to Unity protobuf-net: “invalid field in source data 0”

I create a java server base Netty and use Protostuff handle the data, but when I receive data in game client base unity then deserialize it, but throw an error: "invalid field in source data 0".How can I fix it? Java Code: private…
Joker
  • 11
  • 1
1
vote
1 answer

Protostuff writing list as JSON

What is easiest way to have protostuff behave like standard Jackson serializer? I wanted to be able to serialize object graphs, lists or arrays as root objects but seems there is not even a workaround for this? Here — o is Object that can be of…
Marko Kraljevic
  • 401
  • 4
  • 19
1
vote
2 answers

protobuf payload bigger than JSON?

I have an object that is a list of 'Level' objects and I'm testing transferring them with Spring Boot Rest Controller in 2 ways: with JSON, in Rest Controller I use something like: @RequestMapping(value = "/api/v1/layers/{layername}", method = …
Jolie
  • 33
  • 7
1
vote
2 answers

Jersey validation without annotations

I have a Jersey-based application and I want to add validation to input. @POST @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) public SomeResponce myMethod(@Valid MyBean myBean) Problem is that my beans are generated by protostuff and I…
Serge Harnyk
  • 1,279
  • 10
  • 19
1
vote
1 answer

RuntimeSchema in Protostuff 1.3.8

I am trying to learn how to use Protostuff. I have an example that uses protostuff 1.0.7. In this example the class RuntimeSchema is used. When I try to reproduce the code with a current version of protostuff (1.3.8), I fail, because the class…
thorwinn
  • 123
  • 1
  • 2
  • 9
1
vote
1 answer

Dynamic Schema & Deserialization with Protostuff

I'm using Protostuff in an attempt to serialize/deserialize objects of several different types for which no protobuf sources are available (it's a server-server RPC scenario). Serialization goes OK because I know the type of the object to serialize…
Roy Stark
  • 463
  • 2
  • 15
1
vote
2 answers

how to serialize map to byte array by protostuff

is any method to serialize java.util.Map to byte array when using protostuff, I saw there is a MapSchema in the protostuff-collectionsschema.jar file, but don't know how to use it. can anyone give me some sample code, thanks in advance.
eonezhang
  • 11
  • 4
1
vote
1 answer

Deserializing arrays with protostuff

I am trying to use protostuff to serialize deserialize json but when i serialize the object the size of the array is put in front {"id":1,"price":1.2,"name":"alex","tags":{"a":3,"b":["tag1","tag2","tag2"]}} if i trie to desirialize the same string…
alex529
  • 17
  • 4
1
vote
1 answer

Protostuff - Incorrect output path is generated in Windows for .java files

I am getting error "The filename, directory name, or volume label syntax is incorrect" due to the protostuff-maven-plugin not generating proper output path while it's working fine on Mac. Following are the details: Errors caused by:…
P-S
  • 11
  • 2
1
vote
1 answer

How can I read JSON data from C++ through Java using a piqi definition

We use a 3rd party REST web service which defines their json API using piqi schemas. Our current architecture needs this data to be read through a java client and transferred to a c++ binary. Ideally, I would like all of the POJOs and c++ structs,…
Ajay
  • 763
  • 5
  • 17
1
vote
1 answer

How do you serialize Guava's immutable collections using Protostuff?

I use protostuff-runtime to serialize object graphs. Some of these objects have reference to Guava immutable collections, such as ImmutableList and ImmutableSet. Protostuff is unable to deserialize these collections out of the box, because it tries…
Etienne Neveu
  • 12,604
  • 9
  • 36
  • 59
0
votes
0 answers

problem with an octal to decimal into a CPU/MPU/GPU register

If I sent an octal stream through a serial adder to get a decimal number and used a Dec-To-Bin IC to inject the data into an appropriate register in a *PU just curious; if it's even possible start on my mountain stronghold and interviewing potential…
jesseH
  • 19
  • 5
0
votes
0 answers

how to define in java class to matches the proto blank field definition?

how to define in java class to get runtime schema that matches the proto definition in below message PacketHeader { int32 appId = 1; int64 uid = 2; int64 instanceId = 3; // ------------------------- 4 is blank uint32 flags = 5; } a wrong…
lost.sof
  • 173
  • 1
  • 9
0
votes
0 answers

Is it possible to configure protocol buffers / protostuff to not generate the default empty constructor for a message?

I noticed that protocol buffers / protostuff generate the Java default no-argument constructor when there are required fields. Is there a way to instrument it to not do it for a specific message? Example message Response { required ErrorCode…
0
votes
1 answer

Protostuff runtime schema and polymorphism issues

I have a hierarchy of classes in Java that I want to serialize and deserialize using protostuff. The classes are the following (just a toy example) class Wrapper { public List beings; } class Being { public Animal animal; } class…
slux83
  • 686
  • 9
  • 20