BinaryRead

BinaryRead[stream]

reads one byte of raw binary data from an input stream, and returns an integer from 0 to 255.

BinaryRead[stream,type]

reads an object of the specified type.

BinaryRead[stream,{type1,type2,}]

reads a sequence of objects of the specified types.

Details and Options

Examples

open allclose all

Basic Examples  (1)

Create a file with a sequence of bytes:

Read the first byte from the file:

Read the second byte as an 8-bit character:

Read the next byte as an 8-bit signed integer:

Close the file:

Scope  (1)

Read bytes from the file specified using File object:

Introduced in 2004
 (5.1)
 |
Updated in 2007
 (6.0)
2016
 (11.0)
2019
 (12.0)