Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



Visual C++ Examples

CkString
Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
SSH Key
SSH
SSH Tunnel
SFTP

Unreleased...
Bzip2
LZW
Bz2
Icon

 

 

 

 

 

 

 

 

.gz Format GZip and Ungzip

Demonstrates how to use the CkGZip C++ class to compress and uncompress .gz file format files and memory.

void GZipExample(void)
    {
    // The CkGzip class is included with the "Chilkat Zip" license.
    CkGzip gzip;
    gzip.UnlockComponent("Anything for 30-day trial");

    // ungzip a .gz file:
    gzip.UncompressFile("helloWorld.txt.gz","helloWorld.txt");

    // Create a .gz compressed file.
    gzip.CompressFile("helloWorld.txt","helloWorld2.txt.gz");

    CkByteData byteData;

    // Ungzip from file to memory:
    gzip.UncompressFileToMem("helloWorld.txt.gz",byteData);

    // Access the data:
    const unsigned char *data = byteData.getData();
    int numBytes = byteData.getSize();

    // Compress from memory to file:
    gzip.CompressMemToFile(byteData,"helloWorld3.txt.gz");

    // Memory-to-memory compress:
    CkByteData compressedData;
    gzip.CompressMemory(byteData,compressedData);

    // Access the compressed data:
    data = compressedData.getData();
    numBytes = compressedData.getSize();

    // Memory-to-memory ungzip
    byteData.clear();
    gzip.UncompressMemory(compressedData,byteData);

    // Ungzip from memory to file:
    gzip.UncompressMemToFile(compressedData,"helloWorld4.txt");

    // Compress from file to memory:
    compressedData.clear();
    gzip.CompressFileToMem("helloWorld4.txt",compressedData);

 }


 

 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2008 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Mail Component · XML Parser