Exchange Data Using WXF
Version 12 introduces WXF, an efficient binary format for storing arbitrary expressions. This format is documented, and libraries for reading and writing these files in external languages such as Python are available.
Create a list containing a string of the first 100 code points and a 10×10 matrix of random byte values.
BinarySerialize returns a byte array of the WXF form of an expression. Note that the result only uses about 1 byte per character or value.
Verify that BinaryDeserialize restores the original expressions.
Exporting to a file ending in .wxf will automatically use the "WXF" format.
Verify that file contains the exact same bytes as returned by BinarySerialize.
Similarly, importing a file ending in .wxf will automatically decode "WXF" data.