I'm serializing a large amount of data to send over a network with Boost's serialization libraries.
Boost's serialization libraries require an intermediate file for serialization and deserialization. The volume of data being transmitted makes it awkward to do all of this. Keeping things in memory would be much better.
Is there anything at all in C++ similar to Python's cStringIO/StringIO that I can use to fake out Boost's serialization?
Thanks in advance.
The StringIO module is an in-memory file-like object. This object can be used as input or output to the most function that would expect a standard file object. When the StringIO object is created it is initialized by passing a string to the constructor.
This module implements a file-like class, StringIO, that reads and writes a string buffer (also known as memory files). See the description of file objects for operations (section File Objects). (For standard strings, see str and unicode.)
It is the StringIO module is an in-memory, file-like object. It can be used to input or output the majority of functions users can expect from an ordinary file object. Once the user creates the StringIO objects, it is initially created by providing a string to the constructor.
Yes, it's called stringstream
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With