***************************************************************** * Neveprise Inc. Delphi FAQ * ***************************************************************** * Section: Object pascal Topic: Compressing data * * Created: July 26th, 1999 Revised: July 26th, 1999 * * Updates: www.neveprise.de Info: support@neveprise.de * ***************************************************************** Q: How can I compress files or any other kind of data? A: Of course there are different ways. The fastest and easiest way is to download Zip components that allow you to read and write Zip files. A good address is the Delphi Super Page (DSP). The current web address is http://sunsite.icm.edu.pl /delphi/, if changes please look on the Neveprise website. Another way is to use ZLib, a unit that is delivered with Delphi since version 3. ZLib is a very prominent compressor that has been developed by members of the original Zip pro- ject; it is used today in the PNG file format and compatible to Unix/Linux files like glib. ZLib works on a stream base, that means that you can feed it with all descendands of TStream. Nearly all data-aware types in Delphi offer stream interfaces LoadFromStream() and SaveToStream(), thus it can be used on a very open base. The problem is that ZLib cannot store multiple data units into one package / stream. That means that if you want to create an archiver for example, you have to create your own code that handles this in conjunction with ZLib. Cos this is quite a long "story", it would blow the extends of this FAQ, but you might read my article "Multi Data Files" that will be soon available on the Neveprise website and on Delphi JEDI's Voy- ager articles (www.delphi-jedi.org). Blazko