File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/ICSharpCode.SharpZipLib/Zip Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,9 @@ private void WriteLeLong(long value)
206206 /// Entry name is too long<br/>
207207 /// Finish has already been called<br/>
208208 /// </exception>
209+ /// <exception cref="System.NotImplementedException">
210+ /// The Compression method specified for the entry is unsupported.
211+ /// </exception>
209212 public void PutNextEntry ( ZipEntry entry )
210213 {
211214 if ( entry == null )
@@ -229,6 +232,13 @@ public void PutNextEntry(ZipEntry entry)
229232 }
230233
231234 CompressionMethod method = entry . CompressionMethod ;
235+
236+ // Check that the compression is one that we support
237+ if ( method != CompressionMethod . Deflated && method != CompressionMethod . Stored )
238+ {
239+ throw new NotImplementedException ( "Compression method not supported" ) ;
240+ }
241+
232242 int compressionLevel = defaultCompressionLevel ;
233243
234244 // Clear flags that the library manages internally
You can’t perform that action at this time.
0 commit comments