DocumentationMathematicaThe Mathematica BookMathematica Reference GuideExperimental Context Objects in Mathematica 5
BinaryImport[channel, format] imports binary data from channel 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.
BinaryImport returns an object in which each element of the format specification has been replaced by imported data.
Numerical elements are returned as Mathematica numbers; character and string elements are returned as Mathematica strings.
Elements in a format specification are filled from imported data in the order that they would be accessed by a function such as MapAll.
The channel used in BinaryImport can be a file specified by its name, a pipe or an InputStream.
Under Windows, the input stream must have been opened with DOSTextFormat->False.
When BinaryImport imports data from an input stream, it leaves the stream position directly after what it has imported.
If BinaryImport opens a file or pipe, it closes it again when it is finished.
The following options can be given:
See also: BinaryExport, BinaryImportString, Import, ToCharacterCode.