Difference between revisions of "Zlib.deflate"

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

Latest revision as of 22:38, 1 December 2023

Available since: Gideros 2015.04.18
Class: zlib

Description

Returns a deflated 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) deflated stream