Compressing entirely in memory (Delphi example)
In This Topic
Delphi |
Copy Code |
var xComp : TXceedStreamingCompression; xFormat : XceedStandardCompressionFormat; vaSource : OleVariant; vaDest : OleVariant; begin
xComp := TXceedStreamingCompression.Create( nil ); xComp.License( 'your license key' );
xFormat := CoXceedStandardCompressionFormat.Create();
xComp.CompressionFormat := xFormat;
vaSource := 'This is the data to compress compress compress';
try vaDest := xComp.Compress( vaSource, true );
ShowMessage( 'Data compressed successfully!' ); except on xErr: Exception do ShowMessage( xErr.Message ) end;
xFormat._Release;
xComp.Free; end; |