Boost logo

Boost Users :

From: Anil Krishna (akrishna876_at_[hidden])
Date: 2006-08-07 12:26:40


Thanks a lot Todd.

Really appreciate your help.

Regards,
Anil

On 8/4/06, Todd Greer <TGreer_at_[hidden]> wrote:
>
> Anil Krishna wrote:
>
> > In the above code, I am saving the map to a binary file and retrieving
> it
> > from the file. Instead of that I would want to serialize the data into
> a
> > char buffer and restore it from the buffer.
>
> Serialize into a std::ostringstream, ship its buffer to the other
> receiver, construct a std::istringstream from the received buffer, then
> deserialize from the istringstream you just constructed.
>
> Read up on std::istringstream and std::ostringstream (in <sstream>) for
> the details.
>
> BTW, if the sender and receiver are on different platforms, or you
> happen to need to send the data through something that has a problem
> with binary data, you can use text_[io]archive instead of
> binary_[io]archive.
>
> HTH,
> Todd Greer <tgreer <at> affinegy dot com>
> Senior Software Developer, Affinegy LLC
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net