????? ??????? RAR

?????

Aspose.zip API ???????? ?????????? ?????? ? ???? ???????? ??? ???????????? ???? -???? ????? ????????? ??????.�Aspose.zip API ????? rararchive ????? ??? ?????? ? rar ????????.��API ????? ???? rararchiveentry ??? ????????????? ?????? ????? ? ?????? RAR.

????????? ??????? RAR ?????????.

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

????????? ??????? ???? ??????????, ?? ????????? ????? ?? ????????? ?????????? Rararchive.

 1????????? (rararchive Archive = ????? rararchive ("archive.rar")) {
 2    ????????? (fileOutputStream ??????????? = ????? FileOutputStream (DataDir + "FirstEntry.txt")) {
 3        ????????? (inputStream outer = archive.getentries (). get (0) .open ()) {
 4            ???? [] b = ????? ???? [1024];
 5            int bytesread;
 6            while (0 <(bytesread = source.read (b, 0, b.length))) {
 7                destination.write (b, 0, bytesread);
 8            }
 9        }
10    }
11} ???? (IOException ex) {
12    System.out.println (ex);
13}

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

????????? ??????? ???? ??????????, ?? ????????? ???????????? ????? ?? ????????? ?????????? Rararchive.

1File fi = ????? ???? ("incrypted.rar");
2????????? (rararchive archive = ????? rararchive (files.newinputstream (fi.topath ())) {
3    ????????? (fileOutputStream ??????????? = ????? FileOutputStream (DataDir + "FirstEntry.txt")) {
4        archive.getentries (). get (0) .extract (????? ???????????, "p@s $ w0rd");
5    }
6} ???? (IOException ex) {
7    System.out.println (ex);
8}

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

????????? ??????? ???? ??????????, ?? ??? ????? ? ?????????? Rararchive.

1????????? (rararchive Archive = ????? rararchive ("archive.rar")) {
2    Archive.extracttodirectory ("??????????");
3}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.