ArrayTools
Compress
compress a byte sequence
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Compress(data, opts)
data
-
ByteArray or list of integers
opts
(optional) equation of the form format = value
format = one of bzip2, gzip, zip, or zlib
This option allows a compression format to be specified explicitly. Options are bzip2, gzip, zip, or zlib. The default is zlib.
The Compress(A) command takes the given byte array or list and compresses it into a lossless, more compact format. The return value is a ByteArray.
If A is a list, its contents must be integers between -128 and 127.
Generate a ByteArray of number-theoretic data and compress it.
Compare the size of the original with the compressed result.
Generate random data from a discrete uniform statistical distribution between -10 and 10 and compress it with zip format.
Compute the compression ratio for this example.
Convert a string to a ByteArray and compress it using gzip.
The ArrayTools[Compress] command was introduced in Maple 2015.
For more information on Maple 2015 changes, see Updates in Maple 2015.
The ArrayTools[Compress] command was updated in Maple 2018.
The format option was updated in Maple 2018.
See Also
ArrayTools[Uncompress]
copyright
FileTools[Compressed]
StringTools[Compress]
type/ByteArray
Download Help Document