Re: [protobuf] cannot get extensions from serialized proto -- please help

2011-01-21 Thread Jason Hsueh
You didn't provide a code snippet, so it's hard to say, but I would guess
that you need to provide an ExtensionRegistry and pass that to the parsing
method. (It looks like you are working in Java)

e.g.
ExtensionRegistry extensionRegistry = ExtensionRegistry.newInstance();
YourFileContainerProto.registerAllExtensions(extensionRegistry);
Results r = Results.parseFrom(data, extensionRegistry);

On Fri, Jan 21, 2011 at 8:39 AM, hp  wrote:

> test below is failing..please please help
>
> message Results {
>  extensions 100 to max
>
> }
>
>
> message Item1 {
>  extend Resultes {
>repeated Item1 items = 100;
>}
> }
>
>
> message Item2 {
>  extend Resultes {
>repeated Item2 items = 100;
>}
> }
>
>
> Results.getExtension(items) does not return anything when converted to
> and from byte array.. Works fine otherwise
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to protobuf@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com
> .
> 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 protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] cannot get extensions from serialized proto -- please help

2011-01-21 Thread hp
test below is failing..please please help

message Results {
  extensions 100 to max

}


message Item1 {
 extend Resultes {
repeated Item1 items = 100;
}
}


message Item2 {
 extend Resultes {
repeated Item2 items = 100;
}
}


Results.getExtension(items) does not return anything when converted to
and from byte array.. Works fine otherwise

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.