You are viewing the documentation for a prerelease version. View Latest

Unix compress (.Z)

Read-only: Compress4J can extract this format but cannot create it.

Unix compress support needs no extra dependency. The .Z format has no end marker, so a truncated file decompresses to a shorter output without an error; .tar.Z extraction still fails on a truncated archive because the tar entries are incomplete.

Example Usage

Unix compress Decompression
try (ZDecompressor zDecompressor =
        ZDecompressor.builder(Path.of("example.Z")).build()) {
    zDecompressor.write(Path.of("path/to/file.txt"));
}

The .tar.Z extractor is described on the tar page.