ZLIB.DLL中BLOB变量压缩与解压函数的使用方法
来源:互联网 发布:北京网站制作优化 编辑:程序博客网 时间:2024/05/12 16:17
最近碰上不少朋友问变量压缩的问题,这里整理一下。
函数申明:Function Long compress (Ref blob Destination, Ref ulong DestLen, Ref blob Source, ulong SourceLen ) Library "zlib.dll"Function Long uncompress ( Ref blob Destination, Ref ulong DestLen, Ref blob Sourse, ulong SourceLen ) Library "zlib.dll"压缩函数:public function long of_compress (ref blob abldestination, blob ablsource)
ulong lulSourceLenlong llRCulong luldestinationlength
lulSourceLen = Len( ablSource )
luldestinationlength= (lulSourceLen * 101 / 100) + 12
ablDestination = Blob( Space(luldestinationlength),EncodingANSI! )
llRC = compress( ablDestination, luldestinationlength ,ablSource, lulSourceLen )
ablDestination = BlobMid( ablDestination, 1, luldestinationlength)
ablDestination = BLOB("BUFFER=" + STRING(LEN(ablsource)) + ";", EncodingANSI!) + ablDestination
RETURN llRC
解压函数:public function long of_uncompress (ref blob abldestination, blob ablsource)
ulong lulSourceLen, auldestinationlength long llRCstring ls_srclong ll_pos
ls_src = STRING(ablSource, EncodingANSI!)
ll_pos = POS(ls_src, ";")IF ll_pos > 0 THEN ls_src = MID(ls_src, 1, ll_pos) ablSource = BLOBMID(ablSource, ll_pos + 1) ll_pos = POS(ls_src, "=") ls_src = MID(ls_src, ll_pos + 1) auldestinationlength = LONG(MID(ls_src, 1, LEN(ls_src) - 1))ELSE RETURN -1END IF/////////////////////
lulSourceLen = Len( ablSource )
ablDestination = Blob( Space(aulDestinationLength), EncodingANSI!)
llRC = uncompress( ablDestination, aulDestinationLength, ablSource, lulSourceLen )
ablDestination = BlobMid( ablDestination, 1, aulDestinationLength )
RETURN llRC
- ZLIB.DLL中BLOB变量压缩与解压函数的使用方法
- loadrunner中使用zlib.dll压缩或解压
- VS 2013中添加zlib源文件实现压缩与解压的工程配置过程
- Zlib库对网页中deflate压缩数据的解压
- zlib中compress函数的使用方法
- 用zlib压缩与解压数据
- Android 实现 zlib压缩与解压
- 第三项 zlib压缩与base64解压
- zlib压缩和解压的使用
- zlib最快的压缩/解压写法
- zlib压缩库解压失败的问题
- 使用ZLIB生成DLL文件,并进行有中文的ZIP文件压缩与解压操作!支持目录压与解!
- c++builder ZIP文件解压与压缩(ZLIB DLL调用),目录复制与删除整合的自用类,可自行扩张!
- zlib压缩解压库
- zlib压缩解压
- zlib压缩解压库
- iOS zlib 压缩解压
- ZLIB:gzopen与compress2函数压缩的内容有什么的
- 运用命令行导出导入mysql数据
- dts中为下一步指定数据文本路径
- dom 解析 xml
- java.lang.ProcessBuilder
- Visual Jsf Web Table 绑定到会话Bean业务方法获得的List
- ZLIB.DLL中BLOB变量压缩与解压函数的使用方法
- 人力资源与勤务管理
- 初识WPF
- struts2 部分标签
- C和C++文件读写之异同
- VB.net 打包安装
- java md5 加密
- DTS中文件导出
- Autodesk MapGuide Viewer2009新特性