Re: [protobuf] Problem with reading class

2011-06-02 Thread Pherl Liu
That one will parse from binary encoded data. Looks like your sample_message.txt is in ASCII format. In short: Binary format: serialize: msg.writeTo() / msg.toByteArray() parsing: MyMessage.parseFrom() / builder.mergeFrom() ASCII format: serialize: msg.toString() / TextFormat.printToString()

[protobuf] Problem with reading class

2011-05-25 Thread ch007
Hi all, I wrote a reading class to print the data in the message to the console. the problem is i am not able to print any thing on the console. code is running fine. I think the problem is with the following part. File myFile = new File (C:/Documents and Settings/ch007/Desktop/