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

# [NAME](#NAME)

cereal::PortableBinaryInputArchive - An input archive designed to load data saved using **PortableBinaryOutputArchive**.

# [SYNOPSIS](#SYNOPSIS)

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

Inherits **cereal::InputArchive&lt; PortableBinaryInputArchive, AllowEmptyClassElision &gt;**.

## [Classes](#Classes)

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

## [Public Member Functions](#Public_Member_Functions)

**PortableBinaryInputArchive** (std::istream &stream, **Options** const &options=**Options::Default**())  
Construct, loading from the provided stream. template&lt;std::streamsize DataSize&gt; void **loadBinary** (void \*const data, std::streamsize size)  
Reads size bytes of data from the input stream.

Public Member Functions inherited from **cereal::InputArchive&lt; PortableBinaryInputArchive, AllowEmptyClassElision &gt;**  
**InputArchive** (**PortableBinaryInputArchive** \*const derived)  
Construct the output archive. **InputArchive** & **operator=** (**InputArchive** const &)=delete  
**PortableBinaryInputArchive** & **operator()** (Types &&... args)  
Serializes all passed in data. void **serializeDeferments** ()  
Serializes any data marked for deferment using defer. std::shared\_ptr&lt; void &gt; **getSharedPointer** (std::uint32\_t const id)  
Retrieves a shared pointer given a unique key for it. void **registerSharedPointer** (std::uint32\_t const id, std::shared\_ptr&lt; void &gt; ptr)  
Registers a shared pointer to its unique identifier. std::string **getPolymorphicName** (std::uint32\_t const id)  
Retrieves the string for a polymorphic type given a unique key for it. void **registerPolymorphicName** (std::uint32\_t const id, std::string const &name)  
Registers a polymorphic name string to its unique identifier.

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

**PortableBinaryInputArchive** & **operator&gt;&gt;** (T &&arg)  
Serializes passed in data.

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

## [Additional Inherited Members](#Additional_Inherited_Members)

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

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

# [Detailed Description](#Detailed_Description)

An input archive designed to load data saved using **PortableBinaryOutputArchive**.

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

This archive will load the endianness of the serialized data and if necessary transform it to match that of the local machine. This comes at a significant performance cost compared to non portable archives if the transformation is necessary, and also causes a small performance hit even if it is not necessary.

It is recommended to use portable archives only if you know that you will be sending binary data to machines with different endianness.

The archive will do nothing to ensure types are the same size - that is the responsibility of the user.

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::PortableBinaryInputArchive::PortableBinaryInputArchive (std::istream & stream, **Options** const & options = **Options::Default**()**)** \[inline\]](#cereal::PortableBinaryInputArchive::PortableBinaryInputArchive_%28std::istream_&_stream,_)

Construct, loading from the provided stream.

**Parameters**

*stream* The stream to read from. 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

# [Member Function Documentation](#Member_Function_Documentation)

## [template&lt;std::streamsize DataSize&gt; void cereal::PortableBinaryInputArchive::loadBinary (void \*const data, std::streamsize size) \[inline\]](#template_std::streamsize_DataSize__void_cereal::PortableBinaryInputArchive::loadBinary_%28void_*const_data,_std::streamsize_size%29)

Reads size bytes of data from the input stream.

**Parameters**

*data* The data to save  
*size* The number of bytes in the data

**Template Parameters**

*DataSize* T The size of the actual type of the data elements being loaded

# [Author](#Author)

Generated automatically by Doxygen for cereal from the source code.

Sat Aug 29 2026 00:42:30 cereal

---

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