BinaryData
Obtains a binary data object from an object.
Syntax
-
BinaryData(X)
-
X
is any compatible object
-
Description
If X
is any compatible object, then BinaryData(X)
returns the binary data object containing the raw binary data behind X
.
The following list of compatible data types describes the binary representation of an object of each type. All arrays are packed (that is, no padding between elements).
-
integers
64-bit signed integer, little endian.
-
rational numbers
An array of two 64-bit signed integers: the numerator and the denominator.
-
real numbers
Either an 80-bit extended precision or a 64-bit double precision floating-point number.
-
complex numbers
An array of two real numbers: the real part and the imaginary part.
-
strings
UTF-16 LE
-
booleans
A single byte, either
0x00
(false
) or0x01
(true
). -
real vector
An array of real numbers.
-
complex vector
An array of complex numbers.
-
real matrix
An array of real numbers in row-major order.
-
complex matrix
An array of complex numbers in row-major order.
-
colours
An array of the red, green, blue, and alpha components as 64-bit double-precision floating-point numbers.
-
pixmaps
An array of pixels, each pixel being a 32-bit
0xAABBGGRR
value, in row-major order. -
sounds
An array of samples. The sample rate and the bit depth both depend on the audio and can be queried using the
AudioMetadata
function. -
binary data objects
Raw bytes.