Hi, Kenton,

The main problem is how can I serialize two different objects into one
stream.

e.g.  If I serialize the Text object into one file, how can I append
another object Image into the file.
     Also the methods how to deserialize?   Thanks.

    I found the method Message.AppendToString(string* out),  but I did
not find the matched deserialize method.



On Oct 11, 4:26 am, "Kenton Varda" <[EMAIL PROTECTED]> wrote:
> Sorry, I'm not sure I understand the question.  What, exactly, is the main
> problem you're having?
>
> On Fri, Oct 10, 2008 at 3:11 AM, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]>wrote:
>
>
>
> > I have some kind of requirement that I did not find answer from the
> > document.  May someone help me.
>
> > I have different message objects which are inherited from one parent.
> > I need to serialize the objects into one file.
> > Some kind of solutions like:
> > e.g.
> >  message Style {
> >        optional int32 color = 3;
> >        optional int32 size = 4;
> > }
>
> > message Text {
> >        optional Style style = 3;
> >        optional string context = 4;
> >  }
>
> > message Image {
> >        optional Style style = 3;
>
> >        optional int32 width = 4;
> >        optional int32 height = 5;
> >        optional bytes data = 6;
> >  }
>
> > My Group object includes Text objects and Image objects.  But the
> > position is not fixed.
> > e.g.                    Text.Image.Image...Text
> > and could be:     Image.Text...Image...Text
>
> > Now I need to serialize the objects into one file, and seek for the
> > solution using protocol buffer.
> > Implement this in Java is quite easy, because I can use
> > DataInputStream and serialize the objects.
> > Thanks for any hints.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to