[protobuf] How to get the byte[] from a serialized data ?

2011-03-04 Thread Aditya Narayan
I am trying to use Protocol buffers to store serialized data in Database for a web application built in java. I have created .proto files and compiled them to get the generated classes. Also I can build the message objects using the setters finally build() method. But to store it to

[protobuf] RuntimeException while parsing back the byte[] to protocol buffer message instance! (deserialization)

2011-03-04 Thread Aditya Narayan
I tried following code for encoding and decoding. Decoding from byte[] fails, however. Code:- public static void test(){ Comment comment = Comment.newBuilder() .setCommentBody(This is 1st comment) .build(); byte[] bytes =

[protobuf] RuntimeException while parsing back the byte[] to protocol buffer message instance! (deserialization)

2011-03-04 Thread Aditya Narayan
I tried following code for encoding and decoding. Decoding from byte[] fails, however. Code:- public static void test(){ Comment comment = Comment.newBuilder() .setCommentBody(This is 1st comment) .build(); byte[] bytes =

Re: [protobuf] RuntimeException while parsing back the byte[] to protocol buffer message instance! (deserialization)

2011-03-04 Thread Aditya Narayan
Thanks Evan Seems like I am missing some files. I have just created a .proto file and compiled it with protoc to get generated java files. I got .java file compiled and put it with the java's source folder from protobuf 2.4.a in my project folder. But some of the class dependency of the