Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
.bz2 Compress Memory to FileCompress in-memory data to a .bz2 file.
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, CHILKATFILEACCESSLib_TLB, CHILKATBZ2Lib_TLB, OleCtrls; ... procedure TForm1.Button1Click(Sender: TObject); var bz2: TChilkatBz2; success: Integer; dataToCompress: Array of Byte; fac: TCkFileAccess; begin bz2 := TChilkatBz2.Create(Self); // Any string unlocks the component for the 1st 30-days. success := bz2.UnlockComponent('Anything for 30-day trial.'); if (success <> 1) then begin ShowMessage(bz2.LastErrorText); Exit; end; fac := TCkFileAccess.Create(Self); dataToCompress := fac.ReadEntireFile('hamlet.xml'); success := bz2.CompressMemToFile(dataToCompress,'hamlet.xml.bz2'); if (success <> 1) then begin ShowMessage(bz2.LastErrorText); Exit; end; ShowMessage('Success!'); end; |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.