Whether a byte sequence might represent a format (PNG, CSV, etc.)—Wolfram Documentation

Details

Examples

open all close all

Basic Examples  (1)

Export an image to a GIF string:

Check if the byte array might be a GIF:

Check if the byte array might be a JPEG:

Check if the byte array might be in one of the image formats:

Scope  (1)

Read in a text file as a byte array:

Check if the byte array might be imported as the "Binary" format:

Check if the byte array might be imported as the "Text" format:

Wolfram Research (2020), ByteArrayFormatQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ByteArrayFormatQ.html.

Text

Wolfram Research (2020), ByteArrayFormatQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ByteArrayFormatQ.html.

CMS

Wolfram Language. 2020. "ByteArrayFormatQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ByteArrayFormatQ.html.

APA

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

BibTeX

@misc{reference.wolfram_2025_bytearrayformatq, author="Wolfram Research", title="{ByteArrayFormatQ}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ByteArrayFormatQ.html}", note=[Accessed: 22-February-2026]}

BibLaTeX

@online{reference.wolfram_2025_bytearrayformatq, organization={Wolfram Research}, title={ByteArrayFormatQ}, year={2020}, url={https://reference.wolfram.com/language/ref/ByteArrayFormatQ.html}, note=[Accessed: 22-February-2026]}