Difference between revisions of "Zlib.deflate"

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

Revision as of 10:21, 23 August 2018

Available since: Gideros 2015.04.18

Description

Return a deflate stream.

(stream) = zlib.deflate(sink,level,method,windowBits,memLevel,strategy,dictionary)

'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
Returns (stream) deflate stream