Re: [protobuf] [De]serialization of messages to java strings

2009-11-24 Thread Adam Vartanian
> What am I doing wrong?  What's the best way to do java string > serialization of protobuf messages? The native wire format of protocol buffers is just a sequence of bytes, so it can contain values that are invalid UTF-8 (or any encoding that has invalid byte sequences). Trying to pack that into

Re: [protobuf] [De]serialization of messages to java strings

2009-11-24 Thread Kenton Varda
You can use TextFormat but it is probably *less* efficient than base64. On Tue, Nov 24, 2009 at 4:14 PM, Will Morton wrote: > 2009/11/25 Adam Vartanian : > >> What am I doing wrong? What's the best way to do java string > >> serialization of protobuf messages? > > > > If you absolutely have to

Re: [protobuf] [De]serialization of messages to java strings

2009-11-24 Thread Will Morton
2009/11/25 Adam Vartanian : >> What am I doing wrong?  What's the best way to do java string >> serialization of protobuf messages? > > If you absolutely have to pass things around as a String, you're going > to need to do so in some kind of encoding that supports arbitrary > data.  For example, yo

Re: [protobuf] [De]serialization of messages to java strings

2009-11-24 Thread Kenton Varda
Strings contain text, not arbitrary bytes. Encoded protocol buffers are arbitrary bytes, not text. So, they aren't compatible. You would need to do something like base-64 encode the data in order to put it in a String. On Tue, Nov 24, 2009 at 3:16 PM, Will Morton wrote: > Hello all; > > I nee