?????????????? Zip ? tar.gz
TAR.GZ, ??????????, ???????? ???????? ???????????????? ?????? ???????? ???????? ? ???? Linux, ? ?? ????? ??? ZIP ???????? ???????? ?????????? ??? Windows. ???? ?? ?????? ????????????? ????? ZIP ? Tar.gz, ???????? ??? ??????.
???????????????
Aspose.zip API ????????????? SaveGzippup ??? ?????? ?????? TAR ?? ????. �?? ????? ??????? ?????? ?? ?????? Zip ? ??????, ?? ???????? ??? ? ????????????? ????????? ? ????? ?? ???????? ??? ? ????? ?????.
?????????, ??? ? ??? ?????????? ??????????? ??????, ????? ????????? ?????????? ???? ???????.
????????? ??????
????????? ?????? ???? ?????????????, ??? ??????? ?????? ?? ?????? ZIP ? ?????????? ????????? ?? ? ????? TAR.GZ. ??????, ??????? ???????? ??????????, ?????????, ?? ?? ????? ??????????? ? ????????? ????????????? ?????.
1?????????? (Archive Source = new Archive ("Source.zip")) {
2 ?????????? (Tararchive tar = new Tararchive ()) {
3 ??? (ArchiveEntry ??????: Source.getEntries ()) {
4 if (! entry.isdirectory ()) {
5 BytearRayOutputStream OUT = New BytearRayOutputStream ();
6 try (inputstream mem = intry.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 (), new BytearrayinputStream (out.tobytearray ()));
14 }
15 }
16
17 tar.saveGzipped("result.tar.gz");
18 }
19} catch (ioException ex) {
20 System.out.println (Ex);
21}