Serializing / Deserializing Data
Phoenix2 provides a set of libraries for serializing and deserializing data into a compact binary format. The goal is to offer a simple, efficient, and language-independent mechanism for converting objects into a binary representation that can be stored, transmitted, and reconstructed with minimal overhead.
Compared to text-based formats such as JSON or XML, binary serialization significantly reduces storage requirements and improves read/write performance. It is therefore particularly well suited for high-performance applications where large volumes of data are exchanged or persisted.
A common binary format is used throughout the Phoenix2 ecosystem, ensuring a consistent representation of data across all modules. This format is notably used by communication libraries to exchange messages between processes, but can also be used to persist data in binary storage formats such as HDF5.
Serialization and deserialization are provided by PhoenixDataStream, which offers a unified API for reading and writing binary data.
The binary format is fully interoperable between supported languages, currently C++ and Rust, allowing data serialized in one language to be deserialized transparently in the other.
The binary representation is organized as follows:

