Re: [protobuf] Can we Compress and decompress

2010-10-19 Thread Kenton Varda
Compression is not a built-in feature of protocol buffers, but it is easy and often useful to apply compression on top of the protobuf encoding. In Java, write your data to a GZIPOoutputStream, and then read from a GZIPInputStream. These classes are part of the standard Java library, not the

Re: [protobuf] Can we Compress and decompress

2010-10-19 Thread Igor Gatis
Are C++ and Java GZip streams compatible? On Tue, Oct 19, 2010 at 4:34 PM, Kenton Varda ken...@google.com wrote: Compression is not a built-in feature of protocol buffers, but it is easy and often useful to apply compression on top of the protobuf encoding. In Java, write your data to a

Re: [protobuf] Can we Compress and decompress

2010-10-19 Thread Marc Gravell
In terms of output? GZIP / DEFLATE / etc implementations should be interoperable between platforms, yes. However IIRC the compressed stream is not guaranteed to be byte-identical between specific implementations (but the *decompressed* stream should be byte-identical) Marc On 19 October 2010

Re: [protobuf] Can we Compress and decompress

2010-10-19 Thread Igor Gatis
I mean: if I use Java's GzipOutputStream and then read compressed data using C++'s GzipInputStream, will it work? In other words, are generated streams pure Gzip compliant, in the sense there are no special headers. Could I use unix gzip to unzip a file which its content was generated by Java or

Re: [protobuf] Can we Compress and decompress

2010-10-19 Thread Kenton Varda
On Tue, Oct 19, 2010 at 1:10 PM, Igor Gatis igorga...@gmail.com wrote: In other words, are generated streams pure Gzip compliant, in the sense there are no special headers. Could I use unix gzip to unzip a file which its content was generated by Java or C++ GzipOutputStream? Yes. For C++,

[protobuf] Can we Compress and decompress

2010-10-18 Thread nit
HI All, Can anyone let me know whether the encoded file can be compressed while sending it and decompressed at the receiver's end? The problem is like i have a message structure which has many field and consumes more bytes. So can i compress and Decompress them? thanks, Nithin Shubhananda