java - How to tell protostuff to pack property to fixed32 and not int32 -


i'm trying serialize following java object protobuf using protostuff:

public class headertest {    private int version;   private uuid messageid;    public headertest() {} // required jackson    public headertest(uuid messageid, int version)   {      this.messageid = messageid;     this.version = version;    }    public int getversion() {     return version;   }    public void setversion(int version) {     this.version = version;   }    public uuid getmessageid() {     return messageid;   }    public void setmessageid(uuid messageid) {     this.messageid = messageid;   } } 

with following code:

schema<headertest> headertestschema = runtimeschema.getschema(headertest.class); byte[] headertestbuff = protostuffioutil.tobytearray(headertestinstance, headertestschema, linkedbuffer.allocate()); 

i fixed size buffer protostuff serialize version integer varint type ( amount of bytes use represent integer changes according integer size )

how can tell protostuff serialize specific property fixed32 fix amount of bytes

thanks

runtimeschema not allow select fixed32 type integer field. can use int32/int64.

the thing can - can estimate maximum size of buffer. each int32 takes @ 5 bytes.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -