[erlang-questions] fyi: Google protocol buffers

Richard A. O'Keefe ok@REDACTED
Thu Jul 10 03:15:09 CEST 2008


I spent last night reading the Google Protocol Buffer documentation,
including the wire format.  I really like the use of variable byte
encoding for integers.  One thing that puzzled me was this:
   if I have a stream of bytes coming into a program,
   and that stream of bytes encodes a stream of Messages,
   how do I determine how long the next Message is?
If a Message appears inside another Message, it is encoded as
a byte string (length|string) <encoded message>.  But the
examples they give of stand-alone messages just encode the fields
one after another.  Do you just have to _know_?

The Java interface struck me as far more complex than necessary,
but then, most things in Java strike me as far more complex than
necessary.




More information about the erlang-questions mailing list