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 <[email protected]> 发送时间: 2010-07-23 15:05 主 题: C++ serialization/deserialization examples 收件人: [email protected] 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.
