method
deflate
v1_9_3_125 -
Show latest stable
-
0 notes -
Class: Zlib
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (-38)
- 2_2_9 (-2)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
deflate(p1, p2 = v2)
public
Arguments
string |
|
flush |
Integer representing a flush code. Either NO_FLUSH, SYNC_FLUSH, FULL_FLUSH, or FINISH. See zlib.h for details. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to maximize compression. |
Description
Inputs string into the deflate stream and returns the output from the stream. On calling this method, both the input and the output buffers of the stream are flushed.
If string is nil, this method finishes the stream, just like Zlib::ZStream#finish.
Usage
comp = Zlib.deflate(File.read("big.file"))
or
comp = Zlib.deflate(File.read("big.file"), Zlib::FULL_FLUSH)