Delphi Database, Delphi Components from ComponentAce
Products Download Order Contact us
/img/help/home.gif /img/help/prev.gif /img/help/next.gif

 

Compressing a memory buffer

 


 

With Easy Compression Library compressing and decompressing a memory buffer is a very simple task.

 

Compressing a memory buffer.

To compress a memory buffer you need to call ECLCompressAndEncryptBuffer function.

As the buffer data is not encrypted the Password parameter is to be blank.

This function adds an internal header to compressed data.

 

Decompressing a memory buffer.

To decompress a data from memory buffer you need to call ECLDecompressAndDecryptBuffer.

 

Example:

var

SrcBuf, CompBuf, DecompBuf: PChar;

SrcSize, CompSize, DecompSize: integer;

s: string;

begin

s := 'test-test';

SrcBuf := PChar(s);

SrcSize := Length(s)+1;

ECLCompressAndEncryptBuffer(SrcBuf, SrcSize, CompBuf, CompSize, '', ppmFastest);

ECLDecompressAndDecryptBuffer(CompBuf, CompSize, DecompBuf, DecompSize);

ShowMessage(DecompBuf);

end;

 

        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Dec 01, 2024