Difference between revisions of "Zlib.deflate"
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Available since:''' Gideros 2015.04.18<br/> | + | '''<translate>Available since</translate>:''' Gideros 2015.04.18<br/> |
− | === Description === | + | === <translate>Description</translate> === |
<translate>Return a deflate stream.</translate> | <translate>Return a deflate stream.</translate> | ||
<source lang="lua"> | <source lang="lua"> | ||
(stream) = zlib.deflate(sink,level,method,windowBits,memLevel,strategy,dictionary) | (stream) = zlib.deflate(sink,level,method,windowBits,memLevel,strategy,dictionary) | ||
</source> | </source> | ||
− | === Parameters === | + | === <translate>Parameters</translate> === |
'''sink''': (function or table) <translate>function | { write: function [, close: function, flush: function ] },</translate> <br/> | '''sink''': (function or table) <translate>function | { write: function [, close: function, flush: function ] },</translate> <br/> | ||
'''level''': (number) <translate>compression level, 0 no compression, 9 best compression, -1 default compression</translate> '''optional'''<br/> | '''level''': (number) <translate>compression level, 0 no compression, 9 best compression, -1 default compression</translate> '''optional'''<br/> | ||
Line 14: | Line 14: | ||
'''strategy''': (number) <translate>1 - Filtered, 2 - Huffman, 3 - RLE, 4 - Fixed, 0 - default</translate> '''optional'''<br/> | '''strategy''': (number) <translate>1 - Filtered, 2 - Huffman, 3 - RLE, 4 - Fixed, 0 - default</translate> '''optional'''<br/> | ||
'''dictionary''': (string) <translate>compression dictionary</translate> '''optional'''<br/> | '''dictionary''': (string) <translate>compression dictionary</translate> '''optional'''<br/> | ||
− | === Return values === | + | === <translate>Return values</translate> === |
− | '''Returns''' (stream) <translate>deflate stream</translate><br/> | + | '''<translate>Returns</translate>''' (stream) <translate>deflate stream</translate><br/> |
Revision as of 07:28, 24 August 2018
Available since: Gideros 2015.04.18
Description
Return a deflate stream.
(stream) = zlib.deflate(sink,level,method,windowBits,memLevel,strategy,dictionary)
Parameters
sink: (function or table) function | { write: function [, close: function, flush: function ] },
level: (number) compression level, 0 no compression, 9 best compression, -1 default compression optional
method: (number) compression method, should be 8 for this version optional
windowBits: (number) from 8 to 15, larger values of this parameter result in better compression at the expense of memory usage optional
memLevel: (number) 1 uses minimum memory but is slow and reduces compression ratio; 9 uses maximum memory for optimal speed optional
strategy: (number) 1 - Filtered, 2 - Huffman, 3 - RLE, 4 - Fixed, 0 - default optional
dictionary: (string) compression dictionary optional
Return values
Returns (stream) deflate stream