I have a Java application that reads some protobuf data from another computer and can then modify some values and write it back. It is very likely that a user could read the data using an outdated .proto file, so there would be some fields it doesn't understand in this case. I would ultimately like to preserve the uknown data when writing back the changes made; however, I could settle for just detecting that there is unknown data (to prompt the user to upgrade his/her application). It is not clear to me how to deal with unknown fields in Java.
If it helps, I am using a version 2 .proto file because I need it to be compatible with nanopb on the remote computer.
This question gets me part of the way, but my question has nothing to do with JSON.