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

BinaryReadList

BinaryReadList["file"]
reads all remaining bytes from a file, and returns them as a list of integers from 0 to 255.
BinaryReadList["file", type]
reads objects of the specified type from a file, until the end of the file is reached. The list of objects read is returned.
BinaryReadList["file", {type1, type2, ...}]
reads objects with a sequence of types, until the end of the file is reached.
BinaryReadList["file", types, n]
reads only the first n objects of the specified types.
  • If file is not already open for reading, BinaryReadList opens it, then closes it when it is finished. If the file is already open, BinaryReadList does not close it at the end.
  • BinaryReadList["file", {type1, ...}] reads the sequence of typei in order. If the end of file is reached while partway through this sequence, EndOfFile is returned in place of elements in the sequence that have not yet been read.
Create a file with a sequence of bytes:
Read all the data in the file:
Read the data as objects of a sequence of types:
Create a file with a sequence of bytes:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Read all the data in the file:
In[4]:=
Click for copyable input
Out[4]=
Read the data as objects of a sequence of types:
In[5]:=
Click for copyable input
Out[5]=
New in 5.1