⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gzipdemo.cpp

📁 方便的Gzip压缩解压demo。
💻 CPP
字号:
// gzipdemo.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "../GZipHelper.h"
int _tmain(int argc, _TCHAR* argv[])
{
   /*
	FILE *ain=fopen("d:\\BigExample.txt","rb");
	fseek( ain,0,SEEK_END);
	long size=ftell(ain);
	fseek(ain,0,SEEK_SET);
    
	char* buffer=(char*)malloc(size);
	size_t count0=fread(buffer,1,size,ain);
    CA2GZIP gzip(buffer,size);

    FILE *aout=fopen("d:\\BigExample.gz","wb");
	size_t count1=fwrite(gzip.pgzip,1,gzip.Length,aout);
  */
	
	FILE *in=fopen("d:\\BigExample.gz","rb");
	FILE *out=fopen("c:\\BigExample.txt","wb");
	fseek( in,0,SEEK_END);
	long size=ftell(in);
	fseek(in,0,SEEK_SET);
    LPGZIP buffer=(LPGZIP)malloc(size);
	size_t count0=fread(buffer,1,size,in);
    
	CGZIP2A a(buffer,count0);
	size_t count=strlen(a.psz);
	size_t count1=fwrite(a.psz,1,a.Length,out);
    
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -