Hi Josh,

On 28.04.2018 13:06, Josh Humphries wrote:
> You could use a length-delimited stream of google.protobuf.Any
> messages. The Any message has a URL that encodes the fully-qualified
> type of the message and then also the bytes of the corresponding
> serialized proto. When I say length-delimited, I mean prefix each
> message with a varint-encoded length (or fixed 32-bit length would
> work, too). That is a common way to define a stream of protos, and
> there is some library support -- at least in Java -- for the
> varint-encoded delimited streams.

Thanks. I actually found another solution that seems more elegant and
convenient. After having defined my different message types M1, M2, ...,
I define a wrapper type using `oneof`, and thus after reading the
wrapper object
I can simply query which type is wrapped (using `has_m1()` et al.), and
then access the wrapped object directly.

Cheers,

Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...
    

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to