cereal::PortableBinaryOutputArchive(3) Library Functions Manual cereal::PortableBinaryOutputArchive(3)

# [NAME](#NAME)

cereal::PortableBinaryOutputArchive - An output archive designed to save data in a compact binary representation portable over different architectures.

# [SYNOPSIS](#SYNOPSIS)

#include &lt;/home/build/include/cereal/archives/portable\_binary.hpp&gt;

Inherits **cereal::OutputArchive&lt; PortableBinaryOutputArchive, AllowEmptyClassElision &gt;**.

## [Classes](#Classes)

class **Options**  
A class containing various advanced options for the PortableBinaryOutput archive.

## [Public Member Functions](#Public_Member_Functions)

**PortableBinaryOutputArchive** (std::ostream &stream, **Options** const &options=**Options::Default**())  
Construct, outputting to the provided stream. template&lt;std::streamsize DataSize&gt; void **saveBinary** (const void \*data, std::streamsize size)  
Writes size bytes of data to the output stream.

Public Member Functions inherited from **cereal::OutputArchive&lt; PortableBinaryOutputArchive, AllowEmptyClassElision &gt;**  
**OutputArchive** (**PortableBinaryOutputArchive** \*const derived)  
Construct the output archive. **OutputArchive** & **operator=** (**OutputArchive** const &)=delete  
**PortableBinaryOutputArchive** & **operator()** (Types &&... args)  
Serializes all passed in data. void **serializeDeferments** ()  
Serializes any data marked for deferment using defer. std::uint32\_t **registerSharedPointer** (const std::shared\_ptr&lt; const void &gt; &sharedPointer)  
Registers a shared pointer with the archive. std::uint32\_t **registerPolymorphicType** (char const \*name)  
Registers a polymorphic type name with the archive.

**PortableBinaryOutputArchive** & **operator&** (T &&arg)  
Serializes passed in data.

**PortableBinaryOutputArchive** & **operator&lt;&lt;** (T &&arg)  
Serializes passed in data.

Public Member Functions inherited from **cereal::detail::OutputArchiveBase**  
**OutputArchiveBase** (OutputArchiveBase &&) **CEREAL\_NOEXCEPT**  
OutputArchiveBase & **operator=** (OutputArchiveBase &&) **CEREAL\_NOEXCEPT**

## [Additional Inherited Members](#Additional_Inherited_Members)

using **is\_loading**  
Indicates this archive is not intended for loading.

using **is\_saving**  
Indicates this archive is intended for saving.

# [Detailed Description](#Detailed_Description)

An output archive designed to save data in a compact binary representation portable over different architectures.

This archive outputs data to a stream in an extremely compact binary representation with as little extra metadata as possible.

This archive will record the endianness of the data as well as the desired in/out endianness and assuming that the user takes care of ensuring serialized types are the same size across machines, is portable over different architectures.

When using a binary archive and a file stream, you must use the std::ios::binary format flag to avoid having your data altered inadvertently.

**Warning**

This archive has not been thoroughly tested across different architectures. Please report any issues, optimizations, or feature requests at the project github.

# [Constructor & Destructor Documentation](#Constructor_&_Destructor_Documentation)

## [cereal::PortableBinaryOutputArchive::PortableBinaryOutputArchive (std::ostream & stream, **Options** const & options = **Options::Default**()**)** \[inline\]](#cereal::PortableBinaryOutputArchive::PortableBinaryOutputArchive_%28std::ostream_&_stream,_)

Construct, outputting to the provided stream.

**Parameters**

*stream* The stream to output to. Should be opened with std::ios::binary flag.  
*options* The PortableBinary specific options to use. See the **Options** struct for the values of default parameters

# [Author](#Author)

Generated automatically by Doxygen for cereal from the source code.

Mon Oct 26 2026 20:39:03 cereal

---

Document: cereal_PortableBinaryOutputArchive(3) from cereal 1.3.2-r8 (Chainguard OS)
Source: https://github.com/USCiLab/cereal
