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

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

Experimental`BinaryImport

FilledSmallSquare BinaryImport[channel, format] imports binary data from channel 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 BinaryImport returns an object in which each element of the format specification has been replaced by imported data.

FilledSmallSquare Numerical elements are returned as Mathematica numbers; character and string elements are returned as Mathematica strings.

FilledSmallSquare Elements in a format specification are filled from imported data in the order that they would be accessed by a function such as MapAll.

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

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

FilledSmallSquare When BinaryImport imports data from an input stream, it leaves the stream position directly after what it has imported.

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

FilledSmallSquare The following options can be given:

FilledSmallSquare See also: BinaryExport, BinaryImportString, Import, ToCharacterCode.