Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Zlib
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Capabilities == === Encapsulation === Raw [[DEFLATE]] compressed data (RFC 1951)<ref>{{cite IETF |rfc=1951}}</ref> are typically written with a zlib or gzip wrapper encapsulating the data, by adding a header and footer. This provides stream identification and error detection that are not provided by the raw DEFLATE data. The zlib wrapper (RFC 1950)<ref name=RFC1950>{{cite IETF |rfc=1950}}</ref> is smaller than the gzip wrapper (RFC 1952),<ref>{{cite IETF |rfc=1952}}</ref> as the latter stores a file name and other file system information. === Algorithm === {{As of|2018|9}}, zlib only supports one algorithm, called [[DEFLATE]], which uses a combination of a variation of [[LZ77 and LZ78#LZ77|LZ77]] (Lempel–Ziv 1977) and [[Huffman coding]].<ref>{{cite IETF |rfc=1951}}</ref> This algorithm provides good compression on a wide variety of data with minimal use of system resources. This is also the algorithm used in the [[ZIP (file format)|Zip archive format]]. The header makes allowance for other algorithms, but none are currently implemented. === Resource use === zlib provides facilities for control of processor and memory use. A compression level value may be supplied that trades speed for compression. There are also facilities for conserving memory, useful in restricted memory environments, such as some embedded systems. === Strategy === The compression can be optimized for specific types of data. If one is using the library to always compress specific types of data, then using a specific strategy may improve compression and performance. For example, if the data contain long lengths of repeated bytes, the [[run-length encoding]] (RLE) strategy may give good results at a higher speed. For general data, the default strategy is preferred. === Error handling === Errors in compressed data may be detected and skipped. Further, if "full-flush" points are written to the compressed stream, then corrupt data can be skipped, and the decompression will resynchronize at the next flush point—although no error recovery of the corrupt data is provided. Full-flush points are useful for large data streams on unreliable channels, where some data loss is unimportant, such as in some multimedia applications. However, creating many flush points can affect the speed as well as the amount (ratio) of compression. === Data length === There is no limit to the length of data that can be compressed or decompressed. Repeated calls to the library allow an unlimited number of blocks of data to be handled. Some ancillary code (counters) may suffer from overflow for long data streams, but this does not affect the actual compression or decompression. When compressing a long (or infinite) data stream, it is advisable to write regular full-flush points.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Zlib
(section)
Add topic