?????????? ??????? RAR
Contents
[
Hide
Show
]?????
Aspose.zip API ????????? ????????? ?????? ? ????? ??????????? ??? ????????????? ????? -???? ?????? ????????? ??????.�Aspose.zip API ????????????? Rararchive ????? ??? ?????? ? ???????? RAR.��API ????????????? ????? RararchiveEntry ?????????????? ???? ???? ? ?????? RAR.
???????? ??????? RAR ??????????.
??????? ??????
? ????????? ??????? ???? ???????????????, ??? ??????? ?????? ? ??????? ?????????? Rararchive.
1?????????? (rararchive archive = new Rararchive ("archive.rar")) {
2 try (fileOutputStream destination = new FileOutputStream (datAdir + "firstEntry.txt")) {
3 try (inputstream source = 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} catch (ioException ex) {
12 System.out.println (Ex);
13}????????? ????????????? ??????
????????? ?????? ???? ?????????????, ??? ??????? ????????????? ?????? ? ??????? ?????????? Rararchive.
1File fi = new File ("encrypted.rar");
2try (rararchive archive = new Rararchive (files.newinputstream (fi.topath ()))) {
3 try (fileOutputStream destination = new FileOutputStream (datAdir + "firstEntry.txt")) {
4 archive.getEntries (). get (0) .Extract (??????????, "p@s $ w0rd");
5 }
6} catch (ioException ex) {
7 System.out.println (Ex);
8}?????????? ??????? ????????
????????? ?????? ???? ?????????????, ??? ??? ????? ?? ?????????? Rararchive.
1?????????? (rararchive archive = new Rararchive ("archive.rar")) {
2 archive.extracttodirectory (�????????�);
3}