Class ZLib[in ZLib]

ZLib encapsulation interface.

class ZLib

more...

Summary

compress()Compress a buffer (classwide method).
compressText()Compress a text string (classwide method).
uncompress()Uncompress a buffer (classwide method).
uncompressText()Uncompress a buffer into a text (classwide method).

Detailed description

class ZLib


ZLib encapsulation interface.

Actually, this is a encapsulation class which is used to insolate ZLib functions. Methods in this encapsulation are class-static methods of the ZLib class, and it is not necessary to create an instance of this class to use its methods.

Methods

compress()

Compress a buffer (classwide method).

ZLib.compress( buffer )

bufferA string or a MemBuf to be compressed.
Returns:A compressed buffer (in a byte-wide MemBuf).
Raises:
ZLibErroron compression error.

This method will compress the data considering its raw memory value. This is suitable for bytewise strings loaded from binary streams and byte-wide memory buffers.

Strings containing multi-byte characters can be compressed through this method, but the decompression process must know their original size and perform an adequate trancoding.

For text strings, it is preferrable to use the ZLib.compressText function.

compressText()

Compress a text string (classwide method).

ZLib.compressText( text )

textA string containing a text be compressed.
Returns:A compressed buffer (in a byte-wide MemBuf).
Raises:
ZLibErroron compression error.

This method will compress the a text so that an ZLib.uncompressText re-creates the original string.

uncompress()

Uncompress a buffer (classwide method).

ZLib.uncompress( buffer )

bufferA string or MemBuf containing previusly compressed data.
Returns:A MemBuf containing the uncompressed data.
Raises:
ZLibErroron decompression error.

uncompressText()

Uncompress a buffer into a text (classwide method).

ZLib.uncompressText( buffer )

bufferA MemBuf or string containing previusly compressed text data.
Returns:A uncompressed string.
Raises:
ZLibErroron decompression error.

The input buffer must be a string previously compressed with the ZLib.compressText method, or the function will fail.


Made with faldoc 2.2.0