ByteArrayFormat[ba]
试图确定应使用何种 ImportByteArray 格式来导入 ByteArray 对象 ba.
ByteArrayFormat
ByteArrayFormat[ba]
试图确定应使用何种 ImportByteArray 格式来导入 ByteArray 对象 ba.
更多信息和选项
- ByteArrayFormat 返回 ImportByteArray 使用的格式名称.
- ByteArrayFormat 使用启发式方法,可能无法给出正确的结果,特别是对于较短的字符串.
- ByteArrayFormat 不验证如果应用于 ByteArray 对象 ba,ImportByteArray 是否会成功.
范例
打开所有单元 关闭所有单元基本范例 (1)
范围 (1)
不同 ByteArray 对象的格式解释:
ByteArrayFormat[ByteArray["YWJjZCAxMjM0"]]ByteArrayFormat[ByteArray["MSAyIDMKIDUgNiA3CiA4IDkgMAo="]]ByteArrayFormat[ByteArray["MSwyCiAzLDQKIDUsNgo="]]ByteArrayFormat[ByteArray["MQkyCiAzCTQKIDUJNgo="]]应用 (1)
bytes = ExportByteArray[{{1, 2}, {3, 4}, {5, 6}}, "XLS"]ByteArrayFormat[bytes]ImportByteArray[bytes]BinaryWrite["file.xls", bytes];
Close["file.xls"]Import["file.xls"]属性和关系 (1)
导出到文件并使用 FileFormat 来猜测文件格式:
Export["file.png", RandomImage[]]FileFormat[%]ExportByteArray[RandomImage[], "PNG"]ByteArrayFormat[%]相关指南
-
▪
- 导入和导出
文本
Wolfram Research (2019),ByteArrayFormat,Wolfram 语言函数,https://reference.wolfram.com/language/ref/ByteArrayFormat.html.
CMS
Wolfram 语言. 2019. "ByteArrayFormat." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/ByteArrayFormat.html.
APA
Wolfram 语言. (2019). ByteArrayFormat. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/ByteArrayFormat.html 年
BibTeX
@misc{reference.wolfram_2026_bytearrayformat, author="Wolfram Research", title="{ByteArrayFormat}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/ByteArrayFormat.html}", note=[Accessed: 19-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_bytearrayformat, organization={Wolfram Research}, title={ByteArrayFormat}, year={2019}, url={https://reference.wolfram.com/language/ref/ByteArrayFormat.html}, note=[Accessed: 19-August-2026]}