Re: [protobuf] Why can't we clear UnknownFields from a Java instance?

2011-11-23 Thread Ashwin Jayaprakash
Thanks! A simple example to do that in the docs would be very useful. This is what I did and it works exactly as I wanted it to. Code in redbelow, shows the changes: public class TestPerson { public static void main(String[] args) throws IOException { Person p1 = Person.newBuilder()

Re: [protobuf] Why can't we clear UnknownFields from a Java instance?

2011-11-07 Thread Pherl Liu
You cannot clear the unknown fields in a message because messages are immutable. However, you can parse the bytes into a builder, and then clear the unknowns fields there. On Sat, Oct 22, 2011 at 3:52 PM, Ashwin Jayaprakash ashwin.jayaprak...@gmail.com wrote: Hi, I have 2 simple messages

[protobuf] Why can't we clear UnknownFields from a Java instance?

2011-10-22 Thread Ashwin Jayaprakash
Hi, I have 2 simple messages defined - Person and PersonLite. PersonLite (5 fields) is actually a smaller view of Person (20 fields). I was thinking of using PersonLite to read in the contents of a message that was written by Person. It works alright by reading 5 fields, but PersonLite also