Wolfram Language

Import & Export of ByteArray

ByteArray objects can be used to store file contents. This example shows how a format can be inferred from the byte array representation of a file and how the byte array can be converted to an expression and vice versa.

In[1]:=1
Out[1]=1

This is the first 100 characters of the Base64-encoded byte array.

In[2]:=2
Out[2]=2

Size of the ByteArray is almost equivalent to the file size.

In[3]:=3
Out[3]=3

ByteArrayFormat can be used to check if a given ByteArray object stores data in a supported file format.

In[4]:=4
Out[4]=4

ImportByteArray is an inverse operation that allows to restore expressions from ByteArray.

In[5]:=5
Out[5]=5

ExportByteArray can be used to generate ByteArray objects instead of files for all formats supported by Export.

In[6]:=6
Out[6]=6
In[310]:=In[310]:=

Related Examples

Find out if you already have access to Wolfram tech through your organization
×