Protocol Buffers to file?

I'm not sure why you're creating the DataOutputStream and calling dos. Write in the first place I would normally use this: profile.build(). WriteTo(output) However, I would still have expected the file to be a binary file really.

Sure, it would include the text "123" and "John" as those are just UTF-8 strings... but there should have been non-text in there as well. Are you sure it's just text? Could you post the output?

I'm not sure why you're creating the DataOutputStream and calling dos. Write in the first place... I would normally use this: profile.build(). WriteTo(output); However, I would still have expected the file to be a binary file really.

Sure, it would include the text "123" and "John" as those are just UTF-8 strings... but there should have been non-text in there as well. Are you sure it's just text? Could you post the output?

Here is the ouput: 123John#! I0ad0290e000001296033cf0b540e7ae7#! I0ad0290e000001296033cf0b540e7ae8# Alhtough in before and after 123(and John), there is some weird character in my TextPad which I am not able to copy here.

I am thinking it might be "tab" character – user373307 Jun 22 '10 at 15:11 @workrelated: I suggest you look at the file in a hex editor. Just because a file has recognisable text in doesn't mean it's a text file. Have a look at it in conjunction with the pb format spec.

– Jon Skeet Jun 22 '10 at 15:19 Thanks Jon. I update the question above with my sample code of reading that file. Is that a right approach to do?

– user373307 Jun 22 '10 at 15:23 @workrelated: Again, why are you using a DataInputStream? Just merge straight from the FileInputStream. See the address book example for sample code.

– Jon Skeet Jun 22 '10 at 15:28.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions