?????????????? RAR ? ZIP

Contents
[ Hide Show ]

???? ?? ?????? ????????????? Archive RAR ? ZIP, ?????????? ??? ??????.

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

Aspose.zip API ????????????? Rararchive ????? ??? ?????????? ??????? RAR.�?? ????? ??????? ?????? ? ??????, ?? ???????? ??? ? ????????????? ?????????, ? ????? ?? ??????? ? ????? Zip.

?????????, ??? ? ??? ?????????? ??????????? ??????, ????? ????????? ?????????? ???? ???????.

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

? ????????? ??????? ???? ???????????????, ??? ??????? ?????? ?? ?????? RAR ? ?????????? ????????? ?? ? ????? ZIP. ??????, ??????? ???????? ??????????, ???????????? ? ??????????? ??????, ????? ??????? ???? ???.

 1?????????? (Archive Zip = new Archive ()) {
 2    try (rararchive rar = new Rararchive ("d: \\ archvie.rar")) {
 3        for (int i = 0; i <rar.getEntries (). size (); i ++) {
 4            RararchiveEntry entry = rar.getEntries (). Get (i);
 5            if (! entry.isdirectory ()) {
 6                ?????????? (BytearRayOutputStream OUT = New BytearRayOutputStream ()) {
 7                    intry.extract (out);
 8                    ?????????? (BytearrayinputStream in = new Bytearrayinputstream (out.tobytearray ())) {
 9                        Zip.createEntry (entry.getName (), in);
10                    }
11                }
12            } ??? {
13                Zip.createEntry (entry.getName () + "/", New BytearRayinptStream (????? ???? [0]));
14            }
15        }
16    }
17    zip.save ("output.zip");
18} catch (ioException ex) {
19    System.out.println (Ex);
20}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.