This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / The Mathematica Book / Mathematica Reference Guide / Experimental Context Objects in Mathematica 5 /

Experimental`BinaryExport

FilledSmallSquare BinaryExport[channel, expr, format] exports expr to channel as binary data in the specified format.

FilledSmallSquare The basic elements that can appear in the format specification are:

FilledSmallSquare These elements can be combined in lists or other expressions.

FilledSmallSquare The pattern format.. represents a sequence of one or more copies of a format.

FilledSmallSquare Example: "Byte".. represents a list of one or more bytes.

FilledSmallSquare "Integer32", "Real32".. represents a list of one or more repetitions of a 32-bit integer followed by a single-precision real.

FilledSmallSquare The expressions format and expr are assumed to have the same structure, except for the replacement of patt.. by explicit sequences.

FilledSmallSquare Elements are sent as exported data in the order that they would be accessed by a function such as MapAll.

FilledSmallSquare BinaryExport coerces data to correspond to the format specifications given.

FilledSmallSquare Integers that do not fit have their high-order bits dropped.

FilledSmallSquare The channel used in BinaryExport can be a file specified by its name, a pipe or an OutputStream.

FilledSmallSquare Under Windows, the output stream must have been opened with DOSTextFormat->False.

FilledSmallSquare When BinaryExport exports data to an output stream, it leaves the stream position directly after what it has exported.

FilledSmallSquare If BinaryExport opens a file or pipe, it closes it again when it is finished.

FilledSmallSquare The following options can be given:

FilledSmallSquare See also: BinaryImport, BinaryExportString, Export, FromCharacterCode.