I am having the following error when trying to read the message in java
Exception in thread \"main\" com.google.protobuf.InvalidProtocolBufferException: Prot
When I see users report this type of message, it almost always means they've corrupted the file. Starting from a .txt is a worrying sign, as protocol buffers is a binary format that cannot be represented in a text encoding (unless you count base-64 etc).
Another common cause of this is over-writing a file with less data and not trimming the excess. Since protocol buffers includes (for the root message) neither a length prefix nor a terminator, any excess data (essentially garbage now) from previous file contents will be processed. This is a bad thing; you must always trim your outputs when over-writing.