thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zd.wbh"<zd....@163.com>
Subject 回复: C++ serialization/deserialization examples
Date Fri, 23 Jul 2010 07:13:16 GMT
Raghava, you can use TMemoryBuffer, something like:

 shared_ptr<TMemoryBuffer> strBuffer(new TMemoryBuffer());
 shared_ptr<TBinaryProtocol> binaryProtcol(new TBinaryProtocol(strBuffer));
 strBuffer->resetBuffer((uint8_t*) raw, *lengthPtr);
 obj.read(binaryProtcol.get());

serialization is the oppsite, use write method.


---------------------------------------------------------
一键发送本地文件,请用网易闪电邮(fm.163.com)!



发件人: Raghava Mutharaju <m.vijayaraghava@gmail.com>
发送时间: 2010-07-23 15:05
主 题: C++ serialization/deserialization examples
收件人: thrift-user@incubator.apache.org



Hello all, 

I am using Thrift to share data between applications written in 2 different 
languages (java & c++). I have used TSerializer and TDeserializer for java 
(Binary Protocol) to serialize a message into a file. I haven't found its 
equivalent classes in C++. Can someone suggest how to serialize/deserialize 
using C++. Some steps or small code snippet would be useful. 

Thank you. 

Regards. 
Raghava. 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message