this does not work :-(

      212   // Definimos el buffer al cual vamos a comprimir
      213   const unsigned bufLength = 256;
      214   unsigned char buffer[bufLength];
      215
      216   memset(buffer,0,256);
      217
      218
      219   std::cout << buffer << std::endl;
      220
      221   // Obtenemos un array del proto serializado
      222   google::protobuf::io::ArrayOutputStream 
arrayStream(&buffer,bufLength);
      223
      224   // Introducimos las opciones de compression
      225   GzipOutputStream::Options options;
      226   options.format = GzipOutputStream::GZIP;
      227   options.compression_level = NIVEL_COMPRESION;
      228
      229   google::protobuf::io::GzipOutputStream 
gzip_stream(&arrayStream);
      230   if (!pProto.SerializeToZeroCopyStream(&gzip_stream))
      231   {
      232     std::cerr << "Error comprimiendo el proto a string." << 
std::endl;
      233   }

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to