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 protobuf library. In C++, use the GzipOutputStream and GzipInputStream classes that are provided in the protobuf library (under google/protobuf/io). These simply call zlib to apply compression on top of protocol buffers. On Mon, Oct 18, 2010 at 9:50 PM, nit <nithin.shubhan...@gmail.com> wrote: > 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 > > -- > You received this message because you are subscribed to the Google Groups > "Protocol Buffers" group. > To post to this group, send email to proto...@googlegroups.com. > To unsubscribe from this group, send email to > protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/protobuf?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.