Binary Data

The Wolfram Language provides high-performance reading and writing of binary data, to both files and pipes. A convenient symbolic format representation makes it straightforward to translate published instrumentation or logging specifications to a form that can immediately be used in the Wolfram Language.

(RefLink[BinaryRead, paclet:ref/BinaryRead]) — read one binary object or block of objects

(RefLink[BinaryReadList, paclet:ref/BinaryReadList]) — repeatedly read a binary object or block of objects

(RefLink[ReadByteArray, paclet:ref/ReadByteArray]) — read raw bytes as a (RefLink[ByteArray, paclet:ref/ByteArray]) object.

(RefLink[BinaryWrite, paclet:ref/BinaryWrite]) — write a sequence of binary objects with specified types

(RefLink[Import, paclet:ref/Import]), (RefLink[Export, paclet:ref/Export]) — import, export complete binary files

Binary Types

(StringTypeLink["Bit", paclet:ref/format/Bit]) — individual binary bits ((RefLink[Import, paclet:ref/Import]), (RefLink[Export, paclet:ref/Export]) only)

(StringTypeLink["Byte", paclet:ref/format/Byte]) — 8-bit unsigned integer

(StringTypeLink["Integer8", paclet:ref/format/Integer8]), (StringTypeLink["Integer16", paclet:ref/format/Integer16]), ... — 8-, 16-, 24- 32-, 64-, 128-bit signed integers

(StringTypeLink["UnsignedInteger8", paclet:ref/format/UnsignedInteger8]), ... — 8-, 16-, 24-, 32-, 64-, 128-bit unsigned integers

(StringTypeLink["Real32", paclet:ref/format/Real32]), (StringTypeLink["Real64", paclet:ref/format/Real64]), (StringTypeLink["Real128", paclet:ref/format/Real128]) — IEEE single-, double-, quad-precision real numbers

(StringTypeLink["Complex64", paclet:ref/format/Complex64]), (StringTypeLink["Complex128", paclet:ref/format/Complex128]), (StringTypeLink["Complex256", paclet:ref/format/Complex256]) — IEEE complex numbers

(StringTypeLink["Character8", paclet:ref/format/Character8]), (StringTypeLink["Character16", paclet:ref/format/Character16]) — 8- and 16-bit (Unicode) characters

(StringTypeLink["TerminatedString", paclet:ref/format/TerminatedString]) — null-terminated string

(RefLink[ByteOrdering, paclet:ref/ByteOrdering]) — option for byte ordering (+1 for big endian; -1 for little endian)

(RefLink[$ByteOrdering, paclet:ref/$ByteOrdering]) — native byte ordering on your computer system

(RefLink[ToCharacterCode, paclet:ref/ToCharacterCode]), (RefLink[FromCharacterCode, paclet:ref/FromCharacterCode]) — character code conversion

Byte Arrays

(RefLink[ByteArray, paclet:ref/ByteArray]) — a raw vector of bytes, stored without interpretation

(RefLink[BaseEncode, paclet:ref/BaseEncode]), (RefLink[BaseDecode, paclet:ref/BaseDecode]) — convert between a byte array and its Base64 representation

Numeric Arrays

(RefLink[NumericArray, paclet:ref/NumericArray]) — an array of a numeric type, stored in the most compact representation

Binary Representation of Expressions

Binary Data Formats