Wolfram Research, Inc.
BinaryExport[channel, expr, format] exports expr to channel as binary data in the specified format.
The basic elements that can appear in the format specification are:
These elements can be combined in lists or other expressions.
The pattern format.. represents a sequence of one or more copies of a format.
Example: "Byte".. represents a list of one or more bytes.
"Integer32", "Real32".. represents a list of one or more repetitions of a 32-bit integer followed by a single-precision real.
The expressions format and expr are assumed to have the same structure, except for the replacement of patt.. by explicit sequences.
Elements are sent as exported data in the order that they would be accessed by a function such as MapAll.
BinaryExport coerces data to correspond to the format specifications given.
Integers that do not fit have their high-order bits dropped.
The channel used in BinaryExport can be a file specified by its name, a pipe or an OutputStream.
Under Microsoft Windows, the output stream must have been opened with DOSTextFormat->False.
When BinaryExport exports data to an output stream, it leaves the stream position directly after what it has exported.
If BinaryExport opens a file or pipe, it closes it again when it is finished.
The following options can be given:
See also: BinaryImport, BinaryExportString, Export, FromCharacterCode.
Note: this is an experimental feature, and in future versions of Mathematica it may not be supported, or may have a different specification.