Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
.Z Format Unix Compress and Uncompress Demonstrates how to use the CkUnixCompress C++ class to compress and uncompress .Z file format files and memory. // The CkUnixCompress class is included with the "Chilkat Zip" license.
CkUnixCompress z;
z.UnlockComponent("Anything for 30-day trial");
// Uncompress a .Z file:
z.UncompressFile("helloWorld.txt.Z","helloWorld.txt");
// Create a .Z compressed file.
z.CompressFile("helloWorld.txt","helloWorld2.txt.Z");
CkByteData byteData;
// Uncompress from file to memory:
z.UncompressFileToMem("helloWorld.txt.Z",byteData);
// Access the data:
const unsigned char *data = byteData.getData();
int numBytes = byteData.getSize();
// Compress from memory to file:
z.CompressMemToFile(byteData,"helloWorld3.txt.Z");
// Memory-to-memory compress:
CkByteData compressedData;
z.CompressMemory(byteData,compressedData);
// Access the compressed data:
data = compressedData.getData();
numBytes = compressedData.getSize();
// Memory-to-memory uncompress
byteData.clear();
z.UncompressMemory(compressedData,byteData);
// Uncompress from memory to file:
z.UncompressMemToFile(compressedData,"helloWorld4.txt");
// Compress from file to memory:
compressedData.clear();
z.CompressFileToMem("helloWorld4.txt",compressedData);
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.