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

?????????? ??????? Progress

??????? ?????? ????? ?????? ????? ???????, ???????? ???? ?????? ?????? ????????. ??? ?????? ZIP ?????????? ??????? �??????, ????????????� ([ GetCompressionProgressed/ SetCompressionProgressed), ????? ?????????? ??????????????. ??? ??????? ????????? ?? ProgressEventargs, ??????? ?? ??? ??? ???????? ?????????? ??????????? ??????. ??? ??? ?? ????? ??????????? ?? ??? ???????, ????????? Lambda Expression:

1intry.setCompressionProgressed (((???????????, args) -> {
2    System.out.println (args.getProudeedBytes () + "????? ?????");
3});

????????? ? ???????? ???? ZIP

?????? ???, ????? ??????? �CompressionProgrescesed�, ?? ????????? ????? �????????????� ?? ????? ????????? ?????. ????? ?? ??????? ? ?????? ?????? ??????????? ?????? ??????. ??? ?????? ???????.

 1File Source = new File ("umage.bin");
 2?????????? (Archive Archive = new Archive ()) {
 3    ArchiveEntry intry = archive.createEntry (????????.bin, ????????);
 4    ????????????? int [] inpityReady = new int [1];
 5    intry.setCompressionProgressed (((???????????, args) -> {
 6        int ??????? = (int) ((100 * (long) args.getproudeedbytes ()) / source.length ());
 7        if (???????> ??????? ?????? [0])
 8        {
 9            System.out.println (??????? + "% ??????");
10            ??????? ?????? [0] = ???????;
11        }
12    });
13    archive.save ("output.zip");
14}

????????? 7Z ??????? ?????????

???????? ?????? ??? ?????? 7Z. ??? ?????? ????? ??????????? ?????? ????????? ? ????????? ??????? ( GetCompressionProgressed/ SetCompressionProgressed)

 1File Source = new File ("umage.bin");
 2?????????? (Sevenziparchive Archive = new Sevenziparchive (New SevenzipentrySettings (new Sevenziplzma2compressionsettings ()))) {
 3    SevenziparchiveEntry entry = archive.createEntry ("ugear.bin", ????????);
 4    ????????????? int [] inpityReady = new int [1];
 5    intry.setCompressionProgressed (((???????????, args) -> {
 6        // ??????????? - SevenziparchiveEntry
 7        int ??????? = (int) ((100 * (long) args.getproudeedbytes ()) / source.length ());
 8        if (???????> ??????? ?????? [0])
 9        {
10            System.out.println (??????? + "% ??????");
11            ??????? ?????? [0] = ???????;
12        }
13    });
14    archive.save ("output.zip");
15}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.