Hello,

I'm new in protobuf, and I was wondering if the following is possible. I 
have a protobuf response coming from an api that contains a list of hotels. 
If we imagine this response  in xml, it would be something as follows:
<response><hotels><hotel id="1">H1</hotel><hotel 
id="2">H2</hotel></hotels></response>

I need to split this into 2 pieces:
<response><hotels><hotel id="1">H1</hotel></hotels></response>
<response><hotels><hotel id="2">H2</hotel></hotels></response>

Is it possible to do this if the response is protobuf? Can I put "marks" on 
this protobuf in any way? Something like using "*" below:
<response><hotels>*<hotel id="1">H1</hotel>*<hotel 
id="2">H2</hotel>*</hotels></response>

So I can know where a hotel starts and ends just checking this mark or 
field, and then be able to substract portions of the proto byte array to 
build each piece.

What I want to avoid is to parse the proto, create a java object with the 
whole response, then split each response and convert each one into a 
protobuf again. The idea would be to get this split by only streaming the 
proto.

Thanks,
Joan.



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/8a767294-779b-4e6b-9942-2a5f1b90d29en%40googlegroups.com.

Reply via email to