基于Zlib的压缩/解压缩组件

Dim str As String Dim packed_bytes As Variant Dim unpacked_bytes As Variant str = "随便测试一个相当长的字符串" '压缩packed_bytes = StrConv(str, vbFromUnicode) MsgBox "压缩前字节数:" & LenB(packed_bytes) Call PackStream(packed_bytes) MsgBox "压缩后字节数:" & (UBound(packed_bytes) - LBound(packed_bytes) + 1) '解压缩unpacked_bytes = packed_bytes MsgBox "解压缩前字节数:" & (UBound(unpacked_bytes) - LBound(unpacked_bytes) + 1) Call UnPackStream(unpacked_bytes) MsgBox "解压缩后字节数:" & LenB(unpacked_bytes) str = StrConv(unpacked_bytes, vbUnicode) MsgBox str
zip 文件大小:87.34KB