目 录
1 引言............................................................................................................................................1
1.1 课题背景 ..........................................................................................................................1
1.2 国内外现有的研究成果 ..................................................................................................1
2 压缩与解压缩程序分析............................................................................................................2
2.1 需求分析 ..........................................................................................................................2
2.2 使用的算法理论 ..............................................................................................................2
2.2.1 LZ77 算法简介..........................................................................................................2
2.2.2 Huffman 算法简介 ....................................................................................................3
2.2.3 GZIP 算法原理分析..................................................................................................4
2.3 开发环境 ..........................................................................................................................4
3 总体设计....................................................................................................................................4
3.1 程序功能模块 ..................................................................................................................5
3.2 模块分析与流程图 ..........................................................................................................5
3.2.1 压缩模块....................................................................................................................5
3.2.2 解压缩模块................................................................................................................6
3.3 程序中各个类的初步定义 ..............................................................................................7
4 详细设计和实现........................................................................................................................8
4.1 压缩的程序流程 ..............................................................................................................8
4.2 解压缩的程序流程 ..........................................................................................................9
4.3 主函数代码 ....................................................................................................................10
4.3.1 gzip 压缩模块代码..................................................................................................10
4.3.2 ungzip 解压缩模块代码..........................................................................................11
4.4 程序界面设计 ................................................................................................................12
5 软件系统测试..........................................................................................................................17
5.1 运行环境 ........................................................................................................................17
5.2 测试方法 ........................................................................................................................17
5.3 测试结果 ........................................................................................................................17
5.3.1 使用程序对 txt 文件压缩 .......................................................................................17
5.3.2 使用程序对 bmp 图象文件压缩.............................................................................18
5.3.3 使用程序对 doc 文件压缩......................................................................................18
结 论..............................................................................................................................................18
参考文献..........................................................................................................................................19
致 谢..........................................................................................................................................20
声 明..........................................................................................................................................21