Loading repository data…
Loading repository data…
cybulskii-vladimir / repository
A simple console app for archiving/unarchiving files using a variant of the Huffman Algorithm.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A high-performance, standalone command-line file compression utility written in Kotlin. The project leverages the Canonical Huffman Coding algorithm to achieve lossless binary data compression.
The system is engineered using a highly decoupled architecture split into two discrete functional boundaries:
[ App.kt ] <---> OS File System (File I/O)
|
(InputStream / OutputStream Chaining)
v
[ HuffmanLib.kt ]
├── BitWriter & BitReader (Bit-level Packing)
├── PriorityQueue Encoder (Immutable Trees)
└── Pointer-Walking Decoder (Mutable Nodes)
App.kt)Acts as the external CLI wrapper interface. It isolates the engine from underlying storage constraints by validating file paths, evaluating action mode flags, and translating exceptions into user-friendly diagnostic logs. It initializes high-performance, buffered pipelines on stream primitives.
HuffmanLib.kt)An encapsulated module containing the compression engine and internal structures. All helper nodes, encoders, and code managers are marked private to safeguard module states.
PriorityQueue (\rightarrow) derives standardized code lengths (\rightarrow) streams a optimized bit-header followed by byte-packed tokens using a custom BitWriter.BitReader until hitting character leaves.To set up a local copy of this archiver up and running, follow these simple installation and build steps.
This application runs on the Java Virtual Machine. You only need a Java Development Kit (JDK) installed on your machine.
java -version
git clone https://github.com/cybulskii-vladimir/huffman-archiver.git
cd huffman-archiver
./gradlew build
./gradlew test
git remote set-url origin github_username/huffman-archiver
git remote -v # confirm the changes
This project operates as a CLI application. Since it compiles natively to the JVM, you can interact with it using the built-in Gradle task manager to pipe files through the archiver.
-a / --archive)To compress your raw source files into an optimized binary format, use the -a or --archive flag. Pass your source file path followed by the destination path:
./gradlew run --args="-a text.txt document.huff"
-u / --unarchive)To extract an archive back into its exact original format, use the -u or --unarchive flag:
./gradlew run --args="-u document.huff recovered.txt"
You can confirm that the decompression cycle was perfectly lossless by running a file diff. If the data blocks match identically, the command returns zero terminal output:
diff text.txt recovered.txt
-h / --help)If you forget the syntax parameters, trigger the help driver menu:
./gradlew run --args="-h"
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)Distributed under the MIT License. See LICENSE.txt for more information.
Mail - v.a.tsibulsky@gmail.com
Project Link: https://github.com/cybulskii-vladimir/huffman-archiver