Why not just parse the entire parent message? But if you really want to
avoid that for some reason, probably the easiest approach is to parse the
binary as an EmptyMessage, then look through the unknown fields for your
submessage field and parse the submessage from there.

On Mon, May 25, 2020 at 2:28 AM R P <rainer.posc...@gmail.com> wrote:

> Hello
>
> I want to parse a sub message from a binary super message.
>
> I have found some useful information about message encoding here:
> https://developers.google.com/protocol-buffers/docs/encoding#embedded
>
> From the link:
>
> message Test1 { optional int32 a = 1; }
> message Test3 { optional Test1 c = 3; }
>
> Let's say i have a binary representation of a Test3 message with the sub
> message field 'a' is set to 150:
> 1a 03 08 96 01
>
> Is there a method to parse Test1 message from this binary encoding?
>
> BR
> Rainer
>
> https://developers.google.com/protocol-buffers/docs/encoding#embedded
>
> https://developers.google.com/protocol-buffers/docs/encoding#embedded
>
> https://developers.google.com/protocol-buffers/docs/encoding#embedded
>
> --
> 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 protobuf+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/24115597-43bf-4262-86e4-a861ccd13e21%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/24115597-43bf-4262-86e4-a861ccd13e21%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CADqAXr4gqHDMO4P8n4kOLROM5Huonqy8zvRMZyBfpMnr_OOx0Q%40mail.gmail.com.

Reply via email to