private void testEncode() throws Exception {
OutputStream out = new ByteArrayOutputStream();
CodedOutputStream cos = CodedOutputStream.newInstance(out);
Person.person.Builder person = Person.person.newBuilder();
person.setFirstName("First");
person.setLastName("Last");
person.build().writeTo(cos);
}
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).