Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/ICSharpCode.SharpZipLib/Zip/ZipOutputStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ private void WriteLeLong(long value)
/// Entry name is too long<br/>
/// Finish has already been called<br/>
/// </exception>
/// <exception cref="System.NotImplementedException">
/// The Compression method specified for the entry is unsupported.
/// </exception>
public void PutNextEntry(ZipEntry entry)
{
if (entry == null)
Expand All @@ -229,6 +232,13 @@ public void PutNextEntry(ZipEntry entry)
}

CompressionMethod method = entry.CompressionMethod;

// Check that the compression is one that we support
if (method != CompressionMethod.Deflated && method != CompressionMethod.Stored)
{
throw new NotImplementedException("Compression method not supported");
}

int compressionLevel = defaultCompressionLevel;

// Clear flags that the library manages internally
Expand Down