Gambas Documentation - /comp/gb.compress

# gb.compress

This component allows you to compress and uncompress Files, and to read and write compressed files using standard stream methods. It allows you to compress and uncompress strings in memory, too.

Currently It can use two algorithms, provided by zlib and libbzip2. The more known programs using these algorithms are the command line tools "gzip" and "bzip2", so you can handle the files generated by these programs.

This component internally uses the "libz" and "libbz2" libraries, so you need to install these libraries onto the computers that are going to use the compression component. If you plan to use just one of these algorithms, you don't need to install both libraries.

More information about internals at:

http://www.gzip.org/zlib/

http://sources.redhat.com/bzip2/

All common GNU/Linux distributions include packages for these libraries, FreeBSD and other Unixes too. Both data compressors are patent-free, and currently can be used even in not open source programs, if you follow all the instructions contained in their licenses. (read them carefully for the version you plan to use)

Author | Daniel Campos Fernández.

Class | Description
--- | ---
Compress | This class allows Gambas to use compression algorithms, in order to compress files, strings in memory, and to write a compressed file using standard Stream methods.
Uncompress | This class allows Gambas to use compression algorithms, in order to uncompress files, strings in memory, and to read a compressed file using standard Stream methods.