This is the compiled proto file.
I want to serialize the message (id, title and teh text).
Can someone please help me out with this.
Thanks in advance.



import java.util.Vector;
import java.io.IOException;

import com.ponderingpanda.protobuf.*;

public class Html implements Message {



    private String id; // 1
    private String title; // 2
    private RichText text; // 3

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }


    public RichText getText() {
        return text;
    }

    public void setText(RichText text) {
        this.text = text;
    }


    public final void serialize(CodedOutputStream out) throws
IOException {
        out.writeString(1, id);
        out.writeString(2, title);
        out.writeMessage(3, text);
    }

    public final void deserialize(CodedInputStream in) throws
IOException {
        while(true) {
            int tag = in.readTag();
            switch(tag) {
                case 0:
                    return;
                case 10: {
                    this.id = in.readString();
                    break; }
                case 18: {
                    this.title = in.readString();
                    break; }
                case 26: {
                    this.text = new RichText();
                    in.readMessage(this.text);
                    break; }
                default:
                    in.skipTag(tag);
            }
        }
    }

}

-- 
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