You can find the Memory Compression Sample Application for Delphi in:
SAMPLES\DELPHI 4-7\MEMORYCOMPRESSION
This sample application provides you with an example that compresses and decompresses files using byte arrays, and the Compress and Uncompress methods.
To use the sample, load the MEMCOMP.DPR project file, then build and run the program.