ExportByteArray

Listing of Formats »

ExportByteArray[expr,"format"]

generates a ByteArray object corresponding to expr exported in the specified format.

ExportByteArray[exprs,elems]

generates a ByteArray object by treating exprs as elements specified by elems.

Details

Examples

open allclose all

Basic Examples  (2)

Export an image as a ByteArray object:

Import the bytes to produce the original image:

Export an image as a ByteArray object:

Write the bytes to a temporary file:

Verify the bytes were correctly written by importing the file:

Scope  (2)

Export a typeset mathematical formula as a ByteArray object:

Import the bytes to produce a resolution-independent version of the formula:

Export a color map and corresponding raw data as a ByteArray object:

Import the bytes to produce the original animated GIF image:

Applications  (2)

Store an integer into a ByteArray:

Retrieve the number from the byte array:

Store a big number into a "Base64" encoded ByteArray:

Retrieve the number from the byte array:

Verify the result:

Properties & Relations  (2)

ExportByteArray returns the same result as ExportString followed by StringToByteArray:

ExportByteArray returns the same result as Export followed by ReadByteArray:

Possible Issues  (1)

If the export produces no data, an empty list is returned:

Introduced in 2017
 (11.2)