HolyLib Wiki

AsyncCompress

  util.AsyncCompress( string data, number level = 5, number dictSize = 65536, function callback )

Description

Compresses the given data async.

Instead of copying the given data, we keep a reference to it.
So don't modify it, while were compressing it!

Arguments

1string data
The data to compress
2number level = 5
the level of compression
3number dictSize = 65536
the dictionary size to use
4function callback

the callback that is called after we finished compressing it

Function argument(s):
1string data - The compressed data or nil on failure

Example

Showing the different argument overloads
util.AsyncCompress("Hello world", nil, nil, function(data) print(#data) end) util.AsyncCompress("Hello world", function(data) print(#data) end)