Issue #230: preserve the compression method when getting a compressed stream for encrypted ZIP archives.
This commit is contained in:
parent
60370b8539
commit
8d3fc3533b
1 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue