???????????? ????????? ?? tar.gz
TAR.GZ - ??, ?????????, ???????? ????????? ?????? ?????????? ?????? ? ????? Linux, ???? ?? ZIP ? ??????????????? ??? Windows. ???? ?? ?????? ??????????? Zip Archive ? tar.gz, ?????????? ?? ??????.
???????????
Aspose.zip API ?????????? savegzipped ??? ????????? ?????? ?????? ?? ?????. �?? ?????? ????????? ????? ?? ZIP -?????? ?? ???’???, ?? ?????????? ???? ? ?????????? ??????? ? ?????? ???????? ???? ? ????? ??????.
?????????????, ?? ? ??? ? ???????? ?????????? ???�???, ??? ???????? ????? ???? ???????.
?????????? ?????
????????? ??????? ???? ??????????, ?? ????????? ?????? ? ?????? Zip ? ??????? ????????? ?? ?? ?????? TAR.GZ. ??????, ??? ? ??????????, ?????????????, ??? ?? ????? ????????? ?? ????????? ??????.
1????????? (????? ??????? = ????? ????? ("source.zip")) {
2 ????????? (tararchive tar = new tararchive ()) {
3 ??? (archiveentry ?????: source.getentries ()) {
4 if (! entry.isdirectory ()) {
5 Bytearrayoutputstream = ????? bytearrayoutputstream ();
6 ????????? (inputstream mem = entry.open ()) {
7 ???? [] b = ????? ???? [8192];
8 int bytesread;
9 while (0 <(bytesread = mem.read (b, 0, b.length))) {
10 out.write (b, 0, bytesread);
11 }
12 }
13 tar.createEntry (entry.getName (), ????? ByTeArrayInputStream (out.tobytearray ()));
14 }
15 }
16
17 tar.saveGzipped("result.tar.gz");
18 }
19} ???? (IOException ex) {
20 System.out.println (ex);
21}