文件压缩与解压缩实践 摘 要 随着人们对数据的大量需求以及计算机使用时间的增加,计算机磁盘上的文件越来越大,越来越多。如何让有限的磁盘空间容纳更多的数据成为需要解决的问题。一方面,高速发展的存储技术以提高磁盘容量来解决这样的需求,但随着网络环境下数据传递的产生以及带宽的限制,大容量数据问题日益突出。在这两种需求的推动下,对数据压缩的需求产生了。人们可以将文件在不改变其本身的条件下,将其以更小的占用空间存储,并且在需要的时候将文件恢复成原有的样子,这就是压缩目的。本论文主要研究文件的无损压缩技术,并简要介绍了文件压缩的分类、几种常用的无损压缩格式和常用的压缩算法。运用LZ77字典算法、懒惰匹配算法和Huffman编码算法,使用Java语言在Jbuilder2006环境下设计了使用GZIP算法对文件压缩与解压缩的实现程序。用户可以根据自己的需求,使用此程序方便地对文件进行压缩或者解压缩操作。 关键词:压缩;解压缩;GZIP;Java
Practice of File Compressionand Decompression Abstract As the great demand for data and the usingtime of computer are increasing, computer files on the disk grow more and more.How to make the limited disk space to store more data has became a problem cryingout for solutions. On one hand, the rapid development of storage technology thatcan increase the disk capacity, can meet such demand. However, with theemergence of data transmission in a network environment and the bandwidthlimitations, the problem of large-capacity data is increasingly prominent. Withthe promotion of both demands, the need for data compression and decompressionis generated. People can store a file with a smaller storage space withoutchanging the file’s own condition, and can restore the file; that is thepurpose of data compression and decompression. This treatise principally researchfile lossless compression, otherwise, briefly introduced classification of filecompression, some general lossless compression format and general compression algorithm.A procedure within algorithm called GZIP were designed for file compression anddecompression in Java language under the circumstances of Jbuilder2006,whichused LZ77 dictionary algorithm, lazy match algorithm and Huffman coding algorithm.Users could use this procedure compress or decompress files expedientlyaccording to their demand. Keywords: Compression; Decompression; GZIP; Java
|