BinarySerialize—Wolfram Documentation
Details and Options
- BinarySerialize has the following options:
-
Method Automatic details of serialization methods to use PerformanceGoal Automatic aspects of performance to try to optimize - Possible settings for PerformanceGoal include:
-
"Speed" optimize for serialization and deserialization speed "Size" optimize for smallness of serialized output Automatic automatically pick serialization strategy - Possible settings for Method include:
-
{typespec1enc1,…} specify encodings for particular types Automatic pick encodings automatically based on data - Possible forms for the typespeci include:
-
"PackedArrayIntegerType" integer packed arrays "PackedArrayRealType" real-valued packed arrays "PackedArrayComplexType" complex-valued packed arrays - Possible settings for "PackedArrayIntegerType" include "Integer8", "Integer16", "Integer32" and "Integer64" (64-bit systems only).
- Possible settings for "PackedArrayRealType" include "Real32" and "Real64".
- Possible settings for "PackedArrayComplexType" include "Complex64" and "Complex128".
- The default for the enci encoding specifications is Automatic, in which case BinarySerialize will use a type that fits the data it is given.
- BinarySerialize uses the WXF format.
- BinaryDeserialize is the inverse of BinarySerialize.
Examples
open all close allBasic Examples (2)
Scope (7)
Options (4)
Method (3)
Create a packed array of integer values:
By default, BinarySerialize uses the smallest integer type that fits the data:
Serialize the packed array using a bigger integer type:
Create a packed array of real values:
Serialize the array using machine floats, trading precision for a smaller output:
PerformanceGoal (1)
Applications (1)
Properties & Relations (4)
Possible Issues (2)
From small expressions, PerformanceGoal->"Size" may not produce smaller outputs:
The Method parameter "PackedArrayIntegerType" must be chosen consistently with the data:
These values require 32-bit integers:
A setting of Automatic will always use a size that fits the data:
Related Guides
Text
Wolfram Research (2017), BinarySerialize, Wolfram Language function, https://reference.wolfram.com/language/ref/BinarySerialize.html (updated 2018).
CMS
Wolfram Language. 2017. "BinarySerialize." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2018. https://reference.wolfram.com/language/ref/BinarySerialize.html.
APA
Wolfram Language. (2017). BinarySerialize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BinarySerialize.html
BibTeX
@misc{reference.wolfram_2025_binaryserialize, author="Wolfram Research", title="{BinarySerialize}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/BinarySerialize.html}", note=[Accessed: 22-February-2026]}
BibLaTeX
@online{reference.wolfram_2025_binaryserialize, organization={Wolfram Research}, title={BinarySerialize}, year={2018}, url={https://reference.wolfram.com/language/ref/BinarySerialize.html}, note=[Accessed: 22-February-2026]}