Thanks for your answers. I believe you've answered both of them.
My application unfortunately has very stringent requirements for the
format and layout of the data that will be streamed into and out of
it. Essentially, we will be sending binary data packets over a TCP or
UDP socket. The protocol defines the structures for each message type
rather rigidly.

Thanks again,
Prashanth Nandavanam

On Mar 9, 6:14 pm, Kenton Varda <> wrote:
> On Mon, Mar 9, 2009 at 2:45 PM, anthrope <> wrote:
> > Hello all,
> >    I have only just begun looking at Protocol Buffers, and am
> > intrigued, to say the least. I have taken a quick look at the library,
> > and thought I would post a couple of questions before delvign further.
> > First, is there support for the C/C++ uint16_t type? My application
> > needs to send 2-byte integer fields encoded in big-endian format on a
> > socket.
> If your application needs to encode numbers in a certain way on the wire,
> then you shouldn't use protocol buffers.  But if you are ok with protocol
> buffers encoding the number in the way it wants, then you can just use the
> uint32 type.  For a 16-bit number, it will never use more than three bytes
> to encode (it uses one byte for every 7 bits needed).
> > Second, how does one specify/mandate field sizes? My application needs
> > to send/receive data packets of fixed size fields (which are not
> > encoded as C strings), and I would like to mandate those sizes in
> > the .proto file itself.
> I don't understand what you mean by this.  Are you saying you want protocol
> buffers to encode your message with a specific layout that you define?
>  Sorry, you can't do that.
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to