Difference between revisions of "Zlib.compress"

From GiderosMobile
Line 2: Line 2:
 
'''Available since:''' Gideros 2015.04.18<br/>
 
'''Available since:''' Gideros 2015.04.18<br/>
 
=== Description ===
 
=== Description ===
Return a string containing the compressed buffer according to the given parameters.
+
<translate>Return a string containing the compressed buffer according to the given parameters.</translate>
 
<source lang="lua">
 
<source lang="lua">
 
(string) = zlib.compress(buffer,level,method,windowBits,memLevel,strategy)
 
(string) = zlib.compress(buffer,level,method,windowBits,memLevel,strategy)
 
</source>
 
</source>
 
=== Parameters ===
 
=== Parameters ===
'''buffer''': (string) string to compress <br/>
+
'''buffer''': (string) <translate>string to compress</translate> <br/>
'''level''': (number) compression level, 0 no compression, 9 best compression, -1 default compression '''optional'''<br/>
+
'''level''': (number) <translate>compression level, 0 no compression, 9 best compression, -1 default compression</translate> '''optional'''<br/>
'''method''': (number) compression method, should be 8 for this version '''optional'''<br/>
+
'''method''': (number) <translate>compression method, should be 8 for this version</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/>
+
'''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/>
'''memLevel''': (number) 1 uses minimum memory but is slow and reduces compression ratio; 9 uses maximum memory for optimal speed '''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/>
'''strategy''': (number) 1 - Filtered, 2 - Huffman, 3 - RLE, 4 - Fixed, 0 - default '''optional'''<br/>
+
'''strategy''': (number) <translate>1 - Filtered, 2 - Huffman, 3 - RLE, 4 - Fixed, 0 - default</translate> '''optional'''<br/>
 
=== Return values ===
 
=== Return values ===
'''Returns''' (string) compressed string<br/>
+
'''Returns''' (string) <translate>compressed string</translate><br/>

Revision as of 13:34, 23 August 2018

Available since: Gideros 2015.04.18

Description

Return a string containing the compressed buffer according to the given parameters.

(string) = zlib.compress(buffer,level,method,windowBits,memLevel,strategy)

Parameters

buffer: (string) string to compress
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

Return values

Returns (string) compressed string