{"id":16860,"date":"2023-08-10T19:35:05","date_gmt":"2023-08-10T11:35:05","guid":{"rendered":"https:\/\/www.bookcard.net\/wordpress\/?p=16860"},"modified":"2025-10-22T09:00:10","modified_gmt":"2025-10-22T01:00:10","slug":"android_studio_zlib","status":"publish","type":"post","link":"https:\/\/www.bookcard.net\/wordpress\/android_studio_zlib\/","title":{"rendered":"Android Studio-ZLIB\u58d3\u7e2e\u540c\u89e3\u58d3"},"content":{"rendered":"<figure id=\"attachment_16861\" aria-describedby=\"caption-attachment-16861\" style=\"width: 1280px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2023\/08\/Android_studio_ZLIB.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-16861\" src=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2023\/08\/Android_studio_ZLIB.jpg\" alt=\"Android Studio-ZLIB\u58d3\u7e2e\u540c\u89e3\u58d3\" width=\"1280\" height=\"800\" srcset=\"https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2023\/08\/Android_studio_ZLIB.jpg 1280w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2023\/08\/Android_studio_ZLIB-300x188.jpg 300w, https:\/\/www.bookcard.net\/wordpress\/wp-content\/uploads\/2023\/08\/Android_studio_ZLIB-768x480.jpg 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/a><figcaption id=\"caption-attachment-16861\" class=\"wp-caption-text\">Android Studio-ZLIB\u58d3\u7e2e\u540c\u89e3\u58d3<\/figcaption><\/figure>\n<p>visual_studio_ZLIB<\/p>\n<p>Visual Studio-ZLIB\u58d3\u7e2e\u540c\u89e3\u58d3<\/p>\n<p>\u300e<a href=\"http:\/\/www.zlib.net\/\">ZLIB<\/a>\u300f\u958b\u6e90\u300e\u58d3\u7e2e\u300f\u540c\u300e\u89e3\u58d3\u300f\u7a0b\u5f0f\u5eab, \u652f\u6301\u300eDEFLATE\u300f\u5187\u640d\u58d3\u7e2e\u6f14\u7b97\u6cd5,\u4f62\u6df7\u5408\u300eLZ77\u6f14\u7b97\u6cd5\u300f\u540c\u300e\u970d\u592b\u66fc\u7de8\u78bc\u300f.<\/p>\n<p>\u300eDEFLATE\u300f\u58d3\u7e2e\u6f14\u7b97\u6cd5\u5187\u5c08\u5229\u6b0a.\u7540\u4eba\u5927\u91cf\u61c9\u7528\u4fc2\u300e\u7db2\u7d61\u300f\u300e\u5716\u6a94\u300f\u300e\u6587\u6a94\u300f\u300e\u5f71\u7247\u300f.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">.PNG\/ Libpng<\/td>\n<td width=\"277\">\u5716\u6a94\u89e3\u58d3<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">.ZIP<\/td>\n<td width=\"277\">\u58d3\u7e2e\u6a94<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">.tar<\/td>\n<td width=\"277\">\u58d3\u7e2e\u6a94<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">.gz<\/td>\n<td width=\"277\">\u58d3\u7e2e\u6a94<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">HTTP<\/td>\n<td width=\"277\">\u58d3\u7e2e\u5085\u9001<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">FFmpeg<\/td>\n<td width=\"277\">\u5f71\u7247\u89e3\u58d3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e0b\u8f09\u300e<a href=\"http:\/\/www.zlib.net\/\">ZLIB<\/a>\u300f<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"553\"><a href=\"http:\/\/www.zlib.net\/\">http:\/\/www.zlib.net\/<\/a><\/td>\n<\/tr>\n<tr>\n<td width=\"553\"><a href=\"http:\/\/www.zlib.net\/zlib-1.2.13.tar.gz\">http:\/\/www.zlib.net\/zlib-1.2.13.tar.gz<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u300eAndroid studio\u300f\u5167\u7f6e\u300e<a href=\"http:\/\/www.zlib.net\/\">ZLIB<\/a>\u300f, \u5514\u4f7f\u4e0b\u8f09.\u4f46\u8981\u4fc2\u300eCMakeLists.txt\u300f\u589e\u6dfb\u300ezlib\u300f\u5eab.<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"336\">CMakeLists.txt\u6587\u6a94<\/td>\n<td width=\"217\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"336\">find_library( z-lib z )<\/td>\n<td width=\"217\">\u641c\u7d22zlib<\/td>\n<\/tr>\n<tr>\n<td width=\"336\">target_link_libraries( ${z-lib} )<\/td>\n<td width=\"217\">\u9023\u63a5zlib<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5305\u542b\u300e<a href=\"http:\/\/www.zlib.net\/\">ZLIB<\/a>\u300f\u982d\u6587\u6a94<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"293\">#include &lt;zlib.h&gt;<\/td>\n<td width=\"260\">Zlib-api<\/td>\n<\/tr>\n<tr>\n<td width=\"293\">#include &lt;zconf.h&gt;<\/td>\n<td width=\"260\">&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u300ez_stream\u300f\u58d3\u7e2e\u540c\u89e3\u58d3\u7686\u9700\u6b64\u7d50\u69cb\u9ad4<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">z_stream stream;<\/td>\n<td width=\"277\">zlib\u6d41\u7d50\u69cb\u9ad4<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">stream.zalloc = Z_NULL;<\/td>\n<td width=\"277\">NULL\u7528\u9ed8\u8a8d\u8a18\u61b6\u9ad4\u5206\u914d\u51fd\u6578<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">stream.zfree\u00a0 = Z_NULL;<\/td>\n<td width=\"277\">NULL\u7528\u9ed8\u8a8d\u8a18\u61b6\u9ad4\u91cb\u653e\u51fd\u6578<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">stream.opaque = Z_NULL;<\/td>\n<td width=\"277\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">stream.next_in\u00a0 = (Bytef*)sour;<\/td>\n<td width=\"277\">\u849e\u6e90<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">stream.avail_in = (uInt)sour_length;<\/td>\n<td width=\"277\">\u849e\u6e90\u9577<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">stream.next_out = dest;<\/td>\n<td width=\"277\">\u8f38\u51fa<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">stream.avail_out = (uInt)*dest_length;<\/td>\n<td width=\"277\">\u8f38\u51fa\u9577<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u300e<a href=\"http:\/\/www.zlib.net\/\">ZLIB<\/a>\u300f\u58d3\u7e2e\u5206\u4e09\u6b65<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">\u58d3\u7e2e<\/td>\n<td width=\"277\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">deflateInit(&amp;stream, level)<\/td>\n<td width=\"277\">\u5206\u914d\u8a18\u61b6\u9ad4,level\u58d3\u7e2e\u7b49\u7d1a<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">deflate(&amp;stream, flush);<\/td>\n<td width=\"277\">\u58d3\u7e2e\u6578\u64da, flush\u8a2d0<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">deflateEnd(&amp;stream);<\/td>\n<td width=\"277\">\u91cb\u653e\u8a18\u61b6\u9ad4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"198\">int deflateInit2(<\/td>\n<td width=\"355\">deflateInit()\u52a0\u5f37\u7248<\/td>\n<\/tr>\n<tr>\n<td width=\"198\">z_streamp strm,<\/td>\n<td width=\"355\">zlib\u6d41\u7d50\u69cb\u9ad4<\/td>\n<\/tr>\n<tr>\n<td width=\"198\">int\u00a0 level,<\/td>\n<td width=\"355\">level\u58d3\u7e2e\u7b49\u7d1a0~9.<\/p>\n<p>0:\u901f\u5ea6\u5feb,\u5514\u58d3\u7e2e.<\/p>\n<p>9:\u901f\u5ea6\u6162,\u58d3\u7e2e\u7387\u9ad8.<\/td>\n<\/tr>\n<tr>\n<td width=\"198\">int\u00a0 method,<\/td>\n<td width=\"355\">\u58d3\u7e2e\u6f14\u7b97\u6cd5\u50c5\u652f\u7de9Z_DEFLATED<\/td>\n<\/tr>\n<tr>\n<td width=\"198\">int\u00a0 windowBits,<\/td>\n<td width=\"355\">\u8655\u7406RAW DEFLATE\u624b\u6cd5.<\/td>\n<\/tr>\n<tr>\n<td width=\"198\">int\u00a0 memLevel,<\/td>\n<td width=\"355\">\u6307\u5b9a\u8a18\u61b6\u9ad4\u5206\u914dMAX_MEM_LEVEL<\/td>\n<\/tr>\n<tr>\n<td width=\"198\">int\u00a0 strategy));<\/td>\n<td width=\"355\">\u58d3\u7e2e\u7b56\u7565,\u50c5\u5f71\u97ff\u58d3\u7e2e\u6bd4.\u9ed8\u8a8dZ_DEFAULT_STRATEGY<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"302\">level<\/td>\n<td width=\"251\">\u58d3\u7e2e\u7b49\u7d1a<\/td>\n<\/tr>\n<tr>\n<td width=\"302\">#define Z_NO_COMPRESSION\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<\/td>\n<td width=\"251\">\u5514\u58d3\u7e2e<\/td>\n<\/tr>\n<tr>\n<td width=\"302\">#define Z_BEST_SPEED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1<\/td>\n<td width=\"251\">\u9ad8\u901f,\u4f4e\u58d3\u7e2e\u7387<\/td>\n<\/tr>\n<tr>\n<td width=\"302\">#define Z_BEST_COMPRESSION\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9<\/td>\n<td width=\"251\">\u9ad8\u58d3\u7e2e\u7387, \u6162\u901f<\/td>\n<\/tr>\n<tr>\n<td width=\"302\">#define Z_DEFAULT_COMPRESSION\u00a0 (-1)<\/td>\n<td width=\"251\">\u9ed8\u8a8d\u58d3\u7e2e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">windowBits<\/td>\n<td width=\"277\">\u8655\u7406RAW DEFLATE\u624b\u6cd5.<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">8~15:<\/td>\n<td width=\"277\">\u7d14deflate\u58d3\u7e2e<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">-8~-15:<\/td>\n<td width=\"277\">zlib\u982d + deflate + zlib\u5c3e<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">&gt; 16:<\/td>\n<td width=\"277\">Gzip\u982d+ deflate + Gzip\u5c3e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">method<\/td>\n<td width=\"277\">\u58d3\u7e2e\u6f14\u7b97\u6cd5<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">#define Z_DEFLATED\u00a0\u00a0 8<\/td>\n<td width=\"277\">DEFLATE\u5187\u640d\u58d3\u7e2e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">memLevel<\/td>\n<td width=\"277\">\u8a18\u61b6\u9ad4\u5206\u914d<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">MemLevel=1<\/td>\n<td width=\"277\">\u6700\u5c0f\u8a18\u61b6\u9ad4,\u901f\u5ea6\u6162\u58d3\u7e2e\u6bd4\u4f4e<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">MemLevel=9<\/p>\n<p>#define MAX_MEM_LEVEL 9<\/td>\n<td width=\"277\">\u6700\u5927\u8a18\u61b6\u9ad4,\u6700\u4f73\u901f\u5ea6<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">MemLevel=8<\/td>\n<td width=\"277\">\u9ed8\u8a8d\u503c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">strategy<\/td>\n<td width=\"277\">\u58d3\u7e2e\u6f14\u7b97\u6cd5\u8a2d\u5b9a<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">#define Z_FILTERED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1<\/td>\n<td width=\"277\">\u50c5FILTERED\u751f\u6210\u6578\u64da<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">#define Z_HUFFMAN_ONLY\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2<\/td>\n<td width=\"277\">\u50c5\u970d\u592b\u66fc\u7de8\u78bc<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">#define Z_RLE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3<\/td>\n<td width=\"277\">\u5339\u914d\u9577\u5ea6=1<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">#define Z_FIXED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 4<\/td>\n<td width=\"277\">\u7981\u970d\u592b\u66fc\u7de8\u78bc<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">#define Z_DEFAULT_STRATEGY\u00a0\u00a0\u00a0 0<\/td>\n<td width=\"277\">\u9ed8\u8a8d\u58d3\u7e2e\u8a2d\u5b9a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">int deflate(z_stream *strm, int flush);<\/td>\n<td width=\"277\">\u58d3\u7e2e\/\u89e3\u58d3<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">strm:<\/td>\n<td width=\"277\">z_stream \u7d50\u69cb<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">flush:<\/td>\n<td width=\"277\">\u64cd\u4f5c\u6a19\u8a8c<\/td>\n<\/tr>\n<tr>\n<td width=\"277\"><strong>\u8fd4\u56de\u503c<\/strong><\/td>\n<td width=\"277\">&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">flush<\/td>\n<td width=\"277\">\u64cd\u4f5c\u6a19\u8a8c<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">Z_NO_FLUSH:<\/td>\n<td width=\"277\">\u6a19\u51c6\u58d3\u7e2e\u64cd\u4f5c<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">Z_SYNC_FLUSH:<\/td>\n<td width=\"277\">\u540c\u6b65\u5237\u65b0\u64cd\u4f5c<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">Z_FULL_FLUSH:<\/td>\n<td width=\"277\">\u5b8c\u5168\u5237\u65b0\u64cd\u4f5c<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">Z_FINISH:<\/td>\n<td width=\"277\">\u7d50\u675f\u64cd\u4f5c, \u58d3\u7e2e\u5b8c\u6210\u5f8c\u8fd4\u56de<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"179\">deflate()<strong>\u8fd4\u56de\u503c<\/strong><\/td>\n<td width=\"374\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"179\">Z_OK:<\/td>\n<td width=\"374\">\u58d3\u7e2e\u64cd\u4f5c\u6210\u529f<\/td>\n<\/tr>\n<tr>\n<td width=\"179\">Z_STREAM_END:<\/td>\n<td width=\"374\">\u8f38\u5165\u8cc7\u6599\u91cb\u6578\u58d3\u7e2e, \u58d3\u7e2e\u5668\u8655\u65bc\u7d50\u675f\u72c0\u614b<\/td>\n<\/tr>\n<tr>\n<td width=\"179\">Z_BUF_ERROR:<\/td>\n<td width=\"374\">\u7de9\u885d\u543e\u591f<\/td>\n<\/tr>\n<tr>\n<td width=\"179\">Z_STREAM_ERROR:<\/td>\n<td width=\"374\">\u5167\u90e8\u932f\u8aa4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u300e<a href=\"http:\/\/www.zlib.net\/\">ZLIB<\/a>\u300f\u89e3\u58d3\u5206\u4e09\u6b65<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"277\">\u89e3\u58d3<\/td>\n<td width=\"277\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">inflateInit(&amp;stream)<\/td>\n<td width=\"277\">\u5206\u914d\u8a18\u61b6\u9ad4<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">inflate(&amp;stream, Z_NO_FLUSH);<\/td>\n<td width=\"277\">\u89e3\u58d3\u6578\u64da<\/td>\n<\/tr>\n<tr>\n<td width=\"277\">inflateEnd(stream);<\/td>\n<td width=\"277\">\u91cb\u653e\u8a18\u61b6\u9ad4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"311\">\u8fd4\u56de\u78bc<\/td>\n<td width=\"242\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"311\">#define Z_OK\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0<\/td>\n<td width=\"242\">\u58d3\u7e2e\u64cd\u4f5c\u6210\u529f<\/td>\n<\/tr>\n<tr>\n<td width=\"311\">#define Z_STREAM_END\u00a0\u00a0\u00a0 1<\/td>\n<td width=\"242\">\u8f38\u5165\u8cc7\u6599\u5df2\u7d93\u88ab\u5b8c\u5168\u58d3\u7e2e\uff0c\u4e26\u4e14\u58d3\u7e2e\u5668\u8655\u65bc\u7d50\u675f\u72c0\u614b\u3002<\/td>\n<\/tr>\n<tr>\n<td width=\"311\">#define Z_NEED_DICT\u00a0\u00a0\u00a0\u00a0 2<\/td>\n<td width=\"242\">\u611b\u5bc6\u78bc<\/td>\n<\/tr>\n<tr>\n<td width=\"311\">#define Z_ERRNO\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (-1)<\/td>\n<td width=\"242\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"311\">#define Z_STREAM_ERROR (-2)<\/td>\n<td width=\"242\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"311\">#define Z_DATA_ERROR\u00a0\u00a0 (-3)<\/td>\n<td width=\"242\">\u52a0\u5bc6\u6578\u64da\u640d\u58de\u58de,\u6216\u7f3a\u5931.<\/td>\n<\/tr>\n<tr>\n<td width=\"311\">#define Z_MEM_ERROR\u00a0\u00a0\u00a0 (-4)<\/td>\n<td width=\"242\">\u5514\u5920\u8a18\u61b6\u9ad4<\/td>\n<\/tr>\n<tr>\n<td width=\"311\">#define Z_BUF_ERROR\u00a0\u00a0\u00a0 (-5)<\/td>\n<td width=\"242\">\u5514\u5920\u7de9\u5b58<\/td>\n<\/tr>\n<tr>\n<td width=\"311\">#define Z_VERSION_ERROR (-6)<\/td>\n<td width=\"242\">&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u89e3\u58d3\u793a\u4f8b<\/p>\n<p>int Uncompress_Data_gZip(PBYTE dest,int * dest_length,PBYTE sour,int sour_length)<\/p>\n<p>{<\/p>\n<p>z_stream stream;<\/p>\n<p>int ret;<\/p>\n<p>stream.zalloc = (alloc_func)0;<\/p>\n<p>stream.zfree\u00a0 = (free_func)0;<\/p>\n<p>stream.opaque = (voidpf)0;<\/p>\n<p>stream.next_in\u00a0 = (Bytef*)sour;<\/p>\n<p>stream.avail_in = (uInt)sour_length;<\/p>\n<p>stream.next_out = dest;<\/p>\n<p>stream.avail_out = (uInt)*dest_length;<\/p>\n<p>MAX_MEM_LEVEL<\/p>\n<p>ret = inflateInit2(&amp;stream, 16+MAX_WBITS);<\/p>\n<p>if (ret != Z_OK)<\/p>\n<p>return ret;<\/p>\n<p>&nbsp;<\/p>\n<p>ret = inflate(&amp;stream, Z_NO_FLUSH);\/\/ \u89e3\u58d3<\/p>\n<p>*dest_length = stream.total_out;<\/p>\n<p>inflateEnd(&amp;stream);<\/p>\n<p>return ret;<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>\u58d3\u7e2e\u793a\u4f8b<\/p>\n<p>bool Compress_Data_gZip(PBYTE dest,int * dest_length,PBYTE sour,int sour_length, int level)<\/p>\n<p>{<\/p>\n<p>int ret;<\/p>\n<p>int flush;<\/p>\n<p>\/\/int sour_offset,dest_offset;<\/p>\n<p>\/\/int have;<\/p>\n<p>z_stream stream;<\/p>\n<p>\/\/BYTE in[ZIP_CHUNK];<\/p>\n<p>\/\/BYTE out[ZIP_CHUNK];<\/p>\n<p>&nbsp;<\/p>\n<p>stream.zalloc = Z_NULL;\/\/ \u8a18\u61b6\u9ad4\u5206\u914d\u51fd\u6578<\/p>\n<p>stream.zfree\u00a0 = Z_NULL;\/\/ \u8a18\u61b6\u9ad4\u91cb\u653e\u51fd\u6578<\/p>\n<p>stream.opaque = Z_NULL;<\/p>\n<p>&nbsp;<\/p>\n<p>stream.next_in\u00a0 = (Bytef*)sour;\u00a0\u00a0 \/\/ \u8f38\u5165<\/p>\n<p>stream.avail_in = (uInt)sour_length;<\/p>\n<p>stream.next_out = dest;\/\/\u8f38\u51fa<\/p>\n<p>stream.avail_out = (uInt)*dest_length;<\/p>\n<p>&nbsp;<\/p>\n<p>ret = deflateInit(&amp;stream, level);\/\/ \u5185\u5b58\u5206\u914d<\/p>\n<p>if (ret != Z_OK)<\/p>\n<p>return false;<\/p>\n<p>&nbsp;<\/p>\n<p>flush = Z_FINISH;<\/p>\n<p>\/\/flush = Z_NO_FLUSH;\/\/ \u5141\u8a31\u58d3\u7e2e\u6f14\u7b97\u6cd5\u6c7a\u5b9a\u7d2f\u7a4d\u591a\u5c11\u8cc7\u6599\u518d\u7522\u751f\u8f38\u51fa,\u4ee5\u9054\u5230\u58d3\u7e2e\u6548\u7387\u6700\u9ad8.<\/p>\n<p>&nbsp;<\/p>\n<p>while (ret == Z_OK) {<\/p>\n<p>ret = deflate(&amp;stream, flush);\u00a0 \/\/ \u9032\u884c\u58d3\u7e2e<\/p>\n<p>if (ret == Z_STREAM_END)<\/p>\n<p>break;<\/p>\n<p>else<\/p>\n<p>if (ret == Z_BUF_ERROR)\/\/\u7de9\u885d\u543e\u591f<\/p>\n<p>break;<\/p>\n<p>else<\/p>\n<p>if (ret == Z_STREAM_ERROR)\/\/ \u5167\u90e8\u932f\u8aa4<\/p>\n<p>break;<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>*dest_length = stream.total_out;<\/p>\n<p>&nbsp;<\/p>\n<p>deflateEnd(&amp;stream);\/\/ \u91cb\u653e\u8a18\u61b6\u9ad4<\/p>\n<p>return Z_OK;<\/p>\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>visual_studio_ZLIB Visual Studio-ZLIB\u58d3\u7e2e\u540c\u89e3\u58d3 \u300eZLIB\u300f\u958b\u6e90\u300e\u58d3\u7e2e\u300f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.bookcard.net\/wordpress\/android_studio_zlib\/\" class=\"more-link\">\u7e7c\u7e8c\u95b1\u8b80 <span class=\"screen-reader-text\">Android Studio-ZLIB\u58d3\u7e2e\u540c\u89e3\u58d3<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,13],"tags":[2,42],"class_list":["post-16860","post","type-post","status-publish","format-standard","hentry","category-android","category-pc","tag-android","tag-computer","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/16860","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/comments?post=16860"}],"version-history":[{"count":3,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/16860\/revisions"}],"predecessor-version":[{"id":19433,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/posts\/16860\/revisions\/19433"}],"wp:attachment":[{"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/media?parent=16860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/categories?post=16860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bookcard.net\/wordpress\/wp-json\/wp\/v2\/tags?post=16860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}