zip?7z??????
Contents
[
Hide
Show
]ZIP??????7Z???????????????????????
Aspose.Zip????LZMA?LZMA2?PPMD????BZIP2?????????????7Z????????????????????
??
Aspose.Zip API??7Z?????????? SevenZiparchive?????????? �??????????????????????????????????7Z????????????????
????????????????????????????????????????????
???????
?????????ZIP???????????????????7Z???????????????????? 7Z???????????????????????????????????? LZMA2???????????? ?????????????????????????????????????????????
1try(Archive source = new Archive( "source.zip")){
2 try(sevenziparchive archive = new SevenZiparchive(new SevenZipentrySettings(new SevenZiplzma2CompressIonsettings())){
3 for(archiveentry entry:source.getentries()){
4 if(!entry.isdirectory()){
5 try(bytearrayoutputStream out = new bytearrayoutputStream()){
6 entry.extraw(out);
7 try(bytearrayinputStream in = new bytearrayinputStream(out.tobytearray())){
8 archive.createentry(entry.getName()?in);
9 }
10 }
11 }
12 }
13 archive.save( "result.7z");
14 }
15} catch(ioException ex){
16}