??? ?? ??? ??? ????

??

xz, bzip2 ? lzip? Linux?? ??????. ?? ??? ?? ?? ????? ?? ? ? ????.�aspose.zip api?`setcompressionthreads ‘???? ???? ?? ??? ?? CPU ??? ??? ? ????. ? ???? ???? ?? ?? ??? ?????. ?? ?? ? 1? ???? ?? CPU ??? ?????.

XZ ?? ??? ??

xzarchivesettings?? setCompressionThreads ???? ????. ?? ?? ??? xzarchive ????? ???? ??? ???? ??? ?????.

 1try (fileoutputStream xzfile = new FileOutputStream ( "archive.xz")) {
 2    try (fileInputStream ?? = new FileInputStream ( "data.bin")) {
 3        xzarchivesettings settings = new xzarchivesettings ();
 4        settings.setchecktype (xzchecktype.crc32);
 5        settings.setCompressionThreads (4);
 6        try (xzarchive archive = new xzarchive (settings)) {
 7            Archive.setSource (??);
 8            Archive.save (XZFILE);
 9        }
10    }
11} catch (ioException ex) {
12}

BZIP2 ?? ??? ??

bzip2saveoptions?? setcompressionthreads ???? ????. ?? ?? ??? bzip2archive ????? ???? ??? ???? ??? ?????.

 1try (fileoutputStream bz2file = new FileOutputStream ( "archive.bz2")) {
 2    try (fileInputStream ?? = new FileInputStream ( "data.bin")) {
 3        try (bzip2archive archive = new bzip2archive ()) {
 4            Archive.setSource (??);
 5            bzip2saveoptions ?? = ??? bzip2saveoptions (9);
 6            ?? .SetCompressionThreads (4);
 7            Archive.save (BZ2File, ??);
 8        }
 9    }
10} catch (ioException ex) {
11}

LZIP ?? ??? ??

lziparchivesettings?? setCompressionThreads ???? ????. ?? ?? ??? lziparchive ????? ???? ??? ???? ??? ?????.

 1try (fileoutputStream lzfile = new FileOutputStream ( "archive.lz")) {
 2    try (fileInputStream ?? = new FileInputStream ( "data.bin")) {
 3        lziparchivesettings ?? = ??? lziparchivesettings (16777216);
 4        settings.setCompressionThreads (4);
 5        try (lziparchive archive = new lziparchive (settings)) {
 6            Archive.setSource (??);
 7            Archive.save (lzfile);
 8        }
 9    }
10} catch (ioException ex) {
11}

?? ???? 4 ?? ???? ?????.

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.