I'm trying to get the following to work but nothing is being written to 
the output stream.
any ideas?

    private void testEncode() throws Exception {
        OutputStream out = new ByteArrayOutputStream();
        CodedOutputStream cos = CodedOutputStream.newInstance(out);

        Person.person.Builder person = Person.person.newBuilder();

When I try to decode cos it throws an exception
Exception in thread "main" 
com.google.protobuf.InvalidProtocolBufferException: Protocol message 
contained an invalid tag (zero).

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 
For more options, visit this group at 

Reply via email to