{"id":20183699,"url":"https://github.com/glavo/kala-compress","last_synced_at":"2026-04-02T12:11:24.538Z","repository":{"id":44531606,"uuid":"457471226","full_name":"Glavo/kala-compress","owner":"Glavo","description":"Modular Apache commons compress","archived":false,"fork":false,"pushed_at":"2024-12-09T14:53:07.000Z","size":68518,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-24T06:51:31.014Z","etag":null,"topics":["commons-compress","compress","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Glavo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://afdian.net/@Glavo","https://donate.glavo.org/"]}},"created_at":"2022-02-09T17:59:06.000Z","updated_at":"2025-02-21T15:54:42.000Z","dependencies_parsed_at":"2024-11-30T08:30:41.822Z","dependency_job_id":null,"html_url":"https://github.com/Glavo/kala-compress","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glavo%2Fkala-compress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glavo%2Fkala-compress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glavo%2Fkala-compress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Glavo%2Fkala-compress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Glavo","download_url":"https://codeload.github.com/Glavo/kala-compress/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248162149,"owners_count":21057702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commons-compress","compress","java"],"created_at":"2024-11-14T02:46:59.068Z","updated_at":"2026-04-02T12:11:24.531Z","avatar_url":"https://github.com/Glavo.png","language":"Java","funding_links":["https://afdian.net/@Glavo","https://donate.glavo.org/"],"categories":[],"sub_categories":[],"readme":"Kala Compress\n---\n\n[![Gradle Check](https://github.com/Glavo/compress/actions/workflows/check.yml/badge.svg)](https://github.com/Glavo/compress/actions/workflows/check.yml)\n[![](https://img.shields.io/maven-central/v/org.glavo.kala/kala-compress?label=Maven%20Central)](https://search.maven.org/artifact/org.glavo.kala/kala-compress)\n[![codecov](https://codecov.io/gh/Glavo/commons-compress/graph/badge.svg?token=EKYS1O54XQ)](https://codecov.io/gh/Glavo/commons-compress)\n\nThis project is based on [Apache Commons Compress](https://github.com/apache/commons-compress).\nKala Compress has made some improvements on its basis: Modularization (JPMS Support), NIO2 Path API support, etc.\n\nAnother important improvement of Kala Compress is that it does not depend on libraries such as commons-io and commons-lang3.\nIts core jar has no dependencies and is less than 90KiB in size, making it suitable for programs that have requirements on program size.\n\nIts API is mostly consistent with Apache Commons Compress, with a few incompatibilities.\nSo I renamed the package (and the module name) from `org.apache.commons.compress` to `kala.compress`.\nTherefore, it can coexist with Apache Commons Compress without conflict.\n\nWe assume that you already know about [Commons Compress](https://github.com/apache/commons-compress). \nIf not, please refer to the [User Guide](https://commons.apache.org/proper/commons-compress/examples.html) first.\n\nTo add Kala Compress as a dependency, see section [Modules](#Modules).\n\n## Different from Apache Commons Compress\n\n### Modularization (JPMS Support)\n\nKala Compress has been fully modularized and now fully supports the the JPMS (Java Platform Module System).\n\nEach compressor and archive is split into a separate artifact with a separate module name,\nyou can optionally add dependencies on some of them without importing the entire Kala Compress.\n(The size of Kala Compress core jar is less than 90KB)\n\n`ArchiveStreamFactory` and `CompressorStreamFactory` have been refactored internally \nso that they no longer have hard dependencies on all compressors and archivers,\nbut instead look them up dynamically at runtime.\n\nEach module provides its `module-info.class`, so it can work well with `jlink`.\n\nFor more information about the Kala Compress modules, see [Modules](#Modules).\n\n### Charset\n\nKala Compress has been completely refactored internally to use `java.nio.charset.Charset` to represent encoding.\nAll methods that accept an encoding represented `String` then accept `Charset`.\nIf you are using String to represent the encoding, use `kala.compress.utils.Charsets.toCharset(String)` to convert it to `Charset`.\n\n`ZipEncoding` has been removed, please switch to `Charset`.\n\n`CharsetNames` has been removed, please switch to `StandardCharsets`.\n\nKala Compress no longer uses `Charset.defaultCharset()`, but uses UTF-8 as an alternative.\nNote that `file.encoding` defaults to UTF-8 since Java 18. When you want to use platform native encoding,\nuse the `kala.compress.utils.Charsets.nativeCharset()` explicitly as the alternative.\n\nIn addition, APIs that accept encoding represented by `String` now no longer fall back to the default character set when the encoding is not supported or invalid.\nNow they throw exceptions just like `Charset.forName`. (The behavior when `null` is passed in is not affected, it will still fall back to the UTF-8)\n\n### NIO2 Support\n\nMost of the `java.io.File`-based APIs in commons-compress have been removed, please use the `java.nio.file.Path`-based APIs.\n\n### Rename\n\n`ZipFile` has been renamed to `ZipArchiveReader`.\n\n`TarFile` has been renamed to `TarArchiveReader`.\n\n`SevenZFile` and `SevenZOutputFile` has been renamed to `SevenZArchiveReader` and `SevenZArchiveWriter`.\n\nThe reason for this is that I want to reserve names like `[Archive]File` for a more full-featured support class in the future.\nIt should be able to support both reading and writing archives, adding or deleting entries, etc.\n\n### Deprecation and removal\n\nMost deprecated APIs in Apache Commons Compress have been removed. \n\nUnlike commons-compress, the constructors of `ZipArchiveReader`/`SevenZArchiveReader`  are not deprecated,\nso there is no need to use lengthy builder syntax for simple requirements.\n\nAdditional support for OSGI is no longer provided, but this shouldn't make a big difference.\n\n`ZipEncoding` and `CharsetNames` has been removed, please switch to `Charset` and `StandardCharsets`.\n\nAll methods that accept encoding represented by `String` have been removed, please use the `Charset` instead.\n\nAll methods that accept `java.util.Date` have been removed, please use the `java.nio.file.attribute.FileTime` instead.\n\nSince Security Manager will be removed from JDK in the future, Kala Compress no longer use it.\nFor more details, see [JEP 411: Deprecate the Security Manager for Removal](https://openjdk.java.net/jeps/411).\n\nSince `finalize` method will be removed from JDK in the future, Kala Compress no longer used to clean up resources.\nFor more details, see [JEP 421: Deprecate Finalization for Removal](https://openjdk.java.net/jeps/421).\nThe `archiveName` in the `ZipFile` constructor is only used for error reporting in `finalize`, so it is removed together.\n\nMost methods that accept the `File` have been removed, please use the `Path` instead.\n\n## Modules\n\n**Note: Kala Compress is in beta phase. Although it is developed based on mature Apache Commons Compress and has passed all tests, it may still be unstable. I may need to make some adjustments to the API before releasing to production.**\n\nThe latest Kala Compress version is `1.27.1-3`.\n\nYou can add dependencies on Kala Compress modules as follows:\n\nMaven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.glavo.kala\u003c/groupId\u003e\n  \u003cartifactId\u003e${kala-compress-module-name}\u003c/artifactId\u003e\n  \u003cversion\u003e1.27.1-3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle:\n```kotlin\ndependencies {\n  implementation(\"org.glavo.kala:${kala-compress-module-name}:1.27.1-3\")\n}\n```\n\nAll Kala Compress modules are listed below.\n\n### [`kala.compress`](https://search.maven.org/artifact/org.glavo.kala/kala-compress)\n\nThis is an empty module, which declares the transitivity dependency on all modules of Kala Compress.\nYou can use all the contents of Kala Compress only by adding dependencies on it.\n\n### [`kala.compress.base`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-base) \n\nIt is the basic module of Kala Compress, and all other modules depend on it.\n\nIt contains the following packages:\n\n* (package) `kala.compress`\n* (package) `kala.compress.archivers`\n* (package) `kala.compress.compressors`\n* (package) `kala.compress.compressors.lz77support`\n* (package) `kala.compress.compressors.lzw`\n* (package) `kala.compress.compressors.parallel`\n* (package) `kala.compress.compressors.utils`\n\n### [`kala.compress.compressors`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors)\n\nIt is an empty module that contains transitive dependencies on all compressor modules.\nYou can include all compressors by adding a dependency on it.\n\nIn addition, each compressor in Kala Compress has a separate module, and you can add dependencies on one or all of them separately.\nHere is a list of compressors:\n\n* (module) [`kala-compress-compressors-brotli`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-brotli)\n* (module) [`kala-compress-compressors-bzip2`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-bzip2)\n* (module) [`kala-compress-compressors-deflate`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-deflate)\n* (module) [`kala-compress-compressors-deflate64`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-deflate64)\n* (module) [`kala-compress-compressors-gzip`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-gzip)\n* (module) [`kala-compress-compressors-lz4`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-lz4)\n* (module) [`kala-compress-compressors-lzma`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-lzma)\n* (module) [`kala-compress-compressors-pack200`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-pack200)\n* (module) [`kala-compress-compressors-snappy`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-snappy)\n* (module) [`kala-compress-compressors-xz`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-xz)\n* (module) [`kala-compress-compressors-z`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-z)\n* (module) [`kala-compress-compressors-zstandard`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-compressors-zstandard)\n\nHere are some notes:\n\n* Different from Apache Commons Compress, the `brotli` compressor has no external dependencies.\n  It copies the [Google Brotli](https://github.com/google/brotli) code into package `kala.compress.compressors.brotli.dec`,\n  The reason for this is that Google Brotli does not support JPMS.\n* The `lzma` compressor and the `xz` compressor needs [XZ for Java](https://tukaani.org/xz/java.html) to work.\n* The `zstandard` compressor needs [Zstd JNI](https://github.com/luben/zstd-jni) to work.\n\n### [`kala.compress.archivers`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-archivers)\n\nIt is an empty module that contains transitive dependencies on all archiver modules.\nYou can include all archivers by adding a dependency on it.\n\nIn addition, each archiver in Kala Compress has a separate module, and you can add dependencies on one or all of them separately.\nHere is a list of archivers:\n\n* (module) [`kala-compress-archivers-ar`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-archivers-ar)\n* (module) [`kala-compress-archivers-arj`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-archivers-arj)\n* (module) [`kala-compress-archivers-cpio`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-archivers-cpio)\n* (module) [`kala-compress-archivers-dump`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-archivers-dump)\n* (module) [`kala-compress-archivers-sevenz`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-archivers-sevenz)\n* (module) [`kala-compress-archivers-tar`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-archivers-tar)\n* (module) [`kala-compress-archivers-zip`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-archivers-zip)\n\nHere are some notes:\n\n* The `sevenz` archiver needs [XZ for Java](https://tukaani.org/xz/java.html) to work.\n* The `sevenz` archiver and the `zip` archiver have optional dependencies on the `bzip2` compressor and the `deflate64` compressor.\n  They can work without these compressors, but errors will occur when they are required.\n* Support for `jar` (in package `kala.compress.archivers.jar`) is in the module `kala.compress.archivers.zip`.\n\n### [`kala.compress.changes`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-changes)\n\nIt contains the package `kala.compress.changes`.\n\n### [`kala.compress.examples`](https://search.maven.org/artifact/org.glavo.kala/kala-compress-examples)\n\nIt contains the package `kala.compress.archivers.examples`.\n\n## Bug Report\n\nIf you encounter problems using it, please [open an issue](https://github.com/Glavo/kala-compress/issues/new).\n\nIf it's an issue upstream of Apache Commons Compress, it's best to give feedback [here](https://commons.apache.org/proper/commons-compress/issue-tracking.html) and I'll port the upstream fix here.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglavo%2Fkala-compress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglavo%2Fkala-compress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglavo%2Fkala-compress/lists"}