0

これSharpZipLib用です

SevenZipCompressor に相当するPutNextEntryは何ですか?

私は試した

MemoryStream ms = new MemoryStream(fileByteList.First().Binary);
MemoryStream compressedStream = new MemoryStream(); 
SevenZip.SevenZipCompressor compressor = new SevenZip.SevenZipCompressor();
compressor.DefaultItemName = "toto";
compressor.CompressionMethod = SevenZip.CompressionMethod.Lzma2;
compressor.CompressionLevel = SevenZip.CompressionLevel.Normal;
compressor.CompressStream(ms, compressedStream);


compressor = new SevenZip.SevenZipCompressor();
compressor.CompressionMethod = SevenZip.CompressionMethod.Lzma2;
compressor.CompressionLevel = SevenZip.CompressionLevel.Normal;
compressor.DefaultItemName = "toto2";
MemoryStream ms2 = new MemoryStream(fileByteList[1].Binary); 
compressor.CompressStream(ms2, compressedStream);

MemoryStream ms3 = new MemoryStream();
SevenZip.SevenZipExtractor extractor = new SevenZip.SevenZipExtractor(compressedStream);
extractor.ExtractFile(0, ms3);

エラーが発生します:

An exception of type 'SevenZip.SevenZipArchiveException' occurred in SevenZipSharp.dll but was not handled in user code
Invalid archive: open/read error! Is it encrypted and a wrong password was provided?
If your archive is an exotic one, it is possible that SevenZipSharp has no signature for its format and thus decided it is TAR by mistake. occurred
4

0 に答える 0