A more optimized implementation would allocate those objects/ arrays once per decompressor and reuse them across blocks. This is not strictly necessary because the memory usage for this feature is bounded and relatively small. My implementation dynamic allocates and deallocates memory for each dynamic Huffman block, for the sake of clarity. While this project provides a compliant implementation, my code runs slowly so it should be used as an educational tool only. Deflater, Python has zlib, and zlib is available for C. Test vectors for the decompressor, using the JUnit testing framework.ĭEFLATE is popular enough that essentially every important programming language has a library for it. It handles the gzip headers and footers, and uses the functionality Decompressor for the main data processing.Ī very stripped-down copy of classes from my reference Huffman coding project. PDF Compressor Compress PDF Files Online Select PDF files from your computer or drag them to the drop area. GzipDecompress, which is a command line program that decompresses a gzip file. The project package includes these main items:ĭecompressor, which provides a library function to decompress a raw DEFLATE data stream (having no headers or wrappers). Source codeīrowse the projectâs source code at GitHub: The gzip container format is specified in RFC 1952 ( plain text or PDF). The format has widespread use, and can be found in protocols and file formats such as ZIP, gzip, PNG, HTTP, and Git. ![]() The DEFLATE format is a compression standard specified in RFC 1951 in the year 1996. Consequently, the codebase optimizes for readability and avoids fancy logic, and does not target the best speed/memory/performance. The code can be used for study, and as a solid basis for modification and extension. It is provided in Java, Python, C++, TypeScript, and is open source. This project is a clear implementation of an inflater for the DEFLATE compression format in less than 1000 lines of well-commented code, suitable as a reference for educational purposes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |