RAR ???? ??
Contents
[
Hide
Show
]??
aspose.zip api? ???? ?? ?? ?? ?????? ?? ?????? ????? ?? ? ? ????.�aspose.zip api? rararchive ???? RAR ????? ?? ?????.��API? RAR ???? ??? ?? ??? ?? ?? ?? rararchiveentry ???? ?????.
RAR ???? ???? ??????.
?? ??
?? ?? ??? Rararchive ????? ???? ??? ???? ??? ?????.
1try (rararchive archive = new rararchive ( "archive.rar")) {
2 try (fileoutputStream ?? = ? FileOutputStream (datAdir + "firstentry.txt"))) {
3 try (inputStream ?? = Archive.getEntries (). get (0) .open ()) {
4 ??? [] B = ??? ??? [1024];
5 int bytesread;
6 while (0 <(bytesread = source.read (b, 0, b.length))) {
7 ?? write (b, 0, ??? ???);
8 }
9 }
10 }
11} catch (ioException ex) {
12 System.out.println (?);
13}??? ? ?? ??
?? ?? ??? rararchive ????? ???? ??? ? ??? ???? ??? ?????.
1File fi = ? ?? ( "encrypted.rar");
2try (rararchive archive = new rararchive (files.newinputstream (fi.topath ())) {
3 try (fileoutputStream ?? = ? FileOutputStream (datAdir + "firstentry.txt"))) {
4 archive.getentries (). get (0) .extract (??, "p@s $ w0rd");
5 }
6} catch (ioException ex) {
7 System.out.println (?);
8}?? ???? ??
?? ?? ??? rararchive ????? ?? ??? ?? ??? ?????.
1try (rararchive archive = new rararchive ( "archive.rar")) {
2 Archive.extractTodirectory ( "??");
3}