Take a look at the "Repeated Fields" section in:
https://developers.google.com/protocol-buffers/docs/reference/java-generated#fields


On Thu, Sep 6, 2012 at 11:59 AM, rhlake <[email protected]> wrote:

> I am new to protobufs and have a question concerning "repeated".  I have
> the following .proto file
>
> // See README.txt for information and build instructions.
>
> package HDMetaData;
>
> option java_package = "com.example.HDMetaData";
> option java_outer_classname = "HDMetaDataProtos";
>
> message Song {
>   required string string1 = 1;
>   required string string2 = 2;
>   required string string3 = 3;
>   required string string4 = 4;
>   required string string5 = 5;
>   required uint64 unint1 = 6;
>
> }
>
> // Playlist is made up of multiple Songs
> message Playlist {
>   repeated Song song = 1;  // 1 element in the playlist
>
> }
>
> How would I write/read elements to song1, song2 ... songn    before I
> serialze and deserialize them respectively.  I am currently using
> SerialToArray and ParseFromArray to serialize and deserialize.
>
> Thank You,
> rhlake
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/protobuf/-/ljGQacDfy4YJ.
> 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.
>

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