Once got parsed type, how to project back to original bytes per each field?

12 views
Skip to first unread message

Bingo Zhao

unread,
Jan 30, 2020, 6:12:21 AM1/30/20
to Protocol Buffers
Say I've got a message proto defined as below:
message Msg{
optional int32 a;
optional string b;
optional bytes payload;
...
}

 and got a bunch of bytes [0x.......] parsed as type Msg. I may get all fields contents from Msg object but I'd just want to project the index:length in original bytes which correlating to specified fields(payload field say). What I'm supposed to do achieving this?
Reply all
Reply to author
Forward
0 new messages