mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-22 23:15:20 +00:00
Issue #230: preserve the compression method when getting a compressed stream for encrypted ZIP archives.
This commit is contained in:
@@ -14,7 +14,15 @@ namespace SharpCompress.Archives.Zip
|
||||
|
||||
public virtual Stream OpenEntryStream()
|
||||
{
|
||||
return Parts.Single().GetCompressedStream();
|
||||
var filePart = Parts.Single() as ZipFilePart;
|
||||
var compressionMethod = filePart.Header.CompressionMethod;
|
||||
var stream = filePart.GetCompressedStream();
|
||||
if (filePart.Header.CompressionMethod != compressionMethod)
|
||||
{
|
||||
filePart.Header.CompressionMethod = compressionMethod;
|
||||
}
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
#region IArchiveEntry Members
|
||||
|
||||
Reference in New Issue
Block a user