?????? ? ???????? 7Z

?????

7-ZIP-?????? ????? ? ??????? ???????????? ?????????. Aspose.zip API ???????? ????????? ?? ?????????? ?? ??????????? ???????? 7-ZIP ? ????? ?????? ??? ???????????? ????-???? ????? ????.�Aspose.zip API ????? ????????????????? ???? ??? ?????? ? ???????? 7-ZIP.�??? ???? ????? ????? ?????? ????????? ???????? ?? ???????.�API ????? ???? ????????????????? ??? ????????????? ?????? ????? ? ?????? 7Z.

???????? 7-ZIP-???? ?????

????????? ??????? ???? ??????????, ?? ???????? 7-ZIP-????? ?? ????????? ????????????? ??????????.

1????????? (fileOutputStream sevenzipfile = ????? fileOutputStream ("Archive.7z")) {
2    ????????? (Sevenziparchive Archive = new Sevenziparchive ()) {
3        Archive.createEntry ("data.bin", "file.dat");
4        Archive.Save (Sevenzipfile);
5    }
6} ???? (IOException ex) {
7}

???????? ?????? ?????? 7-ZIP

???? Sevenziparchive ?????????? ?????? CreateEntries ??? ????????? ?????? ?? ?????????, ?????????? ? ???????? ????????.�????????? ??????? ???? ??????????, ?? ???????? ?????? ?????? 7-ZIP.

1????????? (Sevenziparchive Archive = new Sevenziparchive ()) {
2    Archive.CreateEntries ("DataDir");
3    Archive.save ("Sevenzip.7Z");
4}

???????????? ?????????? 7-ZIP

Aspose.zip API ????? ??????????????????????? ????, ???? ?????????? ???????????? ??? ?????????? ??? ???????????? AES ??? ??????? 7Z. ????????? ??????? ???? ??????????, ?? ?????? ????????? ?????????? AES.

1????????? (Sevenziparchive Archive = ????? ???????????? (???? ?????????????????? (null, new SevenzipaesencryptionSettings ("p@s $")))) {
2    Archive.createEntry ("data.bin", ????? ByTeArrayInputStream (????? ???? [] {0x00, (????) 0xff});
3    Archive.save ("Archive.7Z");
4}

AES-256-?????? ???????? ????? ?????????? ??? ?????? 7Z.

7-ZIP-????? ?? ?????????? LZMA

????????? ??????? ???? ??????????, ?? ???????? ????? 7Z ? ?????????? LZMA ?? ??????????? AES.

 1????????? (fileOutputStream sevenzipfile = ????? fileOutputStream ("Archive.7z")) {
 2    ????????? (Sevenziparchive Archive = new Sevenziparchive ()) {
 3        Archive.createEntry ("entry1.bin",
 4                ????? bytearrayinputstream (????? ???? [] {0x00, (????) 0xff}),
 5                ???? SewzipentrySettings (???? ??????????????????????? (),
 6                        ???? SevezipaesencryptionSettings ("test1"),
 7                ????? ???? ("data1.bin"));
 8        Archive.Save (Sevenzipfile);
 9    }
10} ???? (IOException ex) {
11}

?????????? ?? ?????? ??????? ????? 7Z ? ??????? ????????? BZIP2, PPMD ???? LZMA2 ??? ????????? ????? ??? ?????????.

???????????? ??????? ?????? ??? ???????

????????? ??????? ???? ??????????, ?? ???????? ????? ?? ????????, ????????????? ??????? ???????? ??? ??????? ??????.

 1????????? (fileOutputStream sevenzipfile = ????? fileOutputStream ("Archive.7z")) {
 2    ???? fi1 = ????? ???? ("data1.bin");
 3    ???? fi2 = ????? ???? ("data2.bin");
 4    ???? fi3 = ????? ???? ("data3.bin");
 5
 6    try (SevenZipArchive archive = new SevenZipArchive()) {
 7        archive.createEntry("entry1.bin", fi1, false,
 8                new SevenZipEntrySettings(new SevenZipStoreCompressionSettings(),
 9                        new SevenZipAESEncryptionSettings("test1")));
10        archive.createEntry("entry2.bin", fi2, false,
11                new SevenZipEntrySettings(new SevenZipStoreCompressionSettings(),
12                        new SevenZipAESEncryptionSettings("test2")));
13        archive.createEntry("entry3.bin", fi3, false,
14                new SevenZipEntrySettings(new SevenZipStoreCompressionSettings(),
15                        new SevenZipAESEncryptionSettings("test3")));
16        archive.save(sevenZipFile);
17    }
18} ???? (IOException ex) {
19}

????????? ??????? 7Z

????? Aspose.zip ???? ????????? ???????? ?????? LZMA, LZMA2, BZIP2 ?? PPMD.

????????? ??????? ???? ??????????, ?? ????????? ????? 7Z ?? ????????.

1????????? (Sevenziparchive Archive = ????? ???????????? ("Archive.7z")) {
2    Archive.extracttodirectory ("Extractionfolder");
3}

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.