Use CompressionConvertOptions to change the archive format while retaining its contained files. For example, convert a ZIP archive into an ISO image, or re-encode single-file compressed data from GZIP into UUE.
For the reverse conversion, load sample.iso, use CompressionFileType.Zip, and save to converted.zip. Java 26.10 also provides conversion between ISO and TAR, CPIO, or 7Z archives.
Convert GZIP to UUE
UUE encodes a single file. This example changes a GZIP-compressed payload into UUE without converting the payload document itself.
Not every source archive can be converted to every target format. Check the source’s available targets with Getting Possible Conversions before choosing CompressionFileType.
Use a complete-document output path or stream for archive conversion. Page-by-page output is not supported for the ISO and UUE conversions shown here. Converting an ordinary PDF or Word document directly to an archive is also a different operation; these examples require an archive or single-file compression format as input.