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.

Details and Options

  • BinaryReadList supports the same types and options as BinaryRead.
  • 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.
  • BinaryReadList["!command",] reads from a pipe.
  • BinaryReadList[stream] reads from an open input stream, as returned by OpenRead with BinaryFormat->True.
  • BinaryReadList[File["file"]] is also supported.
  • List of all options

Examples

open allclose all

Basic Examples  (1)

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:

Scope  (1)

Read bytes from the file specified using File object:

Properties & Relations  (1)

BinaryReadList reads all the bytes in a file, returning them as a list:

ReadByteArray reads all the bytes, returning them as a ByteArray object:

Wolfram Research (2004), BinaryReadList, Wolfram Language function, https://reference.wolfram.com/language/ref/BinaryReadList.html (updated 2016).

Text

Wolfram Research (2004), BinaryReadList, Wolfram Language function, https://reference.wolfram.com/language/ref/BinaryReadList.html (updated 2016).

CMS

Wolfram Language. 2004. "BinaryReadList." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/BinaryReadList.html.

APA

Wolfram Language. (2004). BinaryReadList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BinaryReadList.html

BibTeX

@misc{reference.wolfram_2024_binaryreadlist, author="Wolfram Research", title="{BinaryReadList}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/BinaryReadList.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_binaryreadlist, organization={Wolfram Research}, title={BinaryReadList}, year={2016}, url={https://reference.wolfram.com/language/ref/BinaryReadList.html}, note=[Accessed: 21-November-2024 ]}