File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
src/ICSharpCode.SharpZipLib/Zip Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -1278,7 +1278,8 @@ public static bool IsCompressionMethodSupported(CompressionMethod method)
12781278 {
12791279 return
12801280 ( method == CompressionMethod . Deflated ) ||
1281- ( method == CompressionMethod . Stored ) ;
1281+ ( method == CompressionMethod . Stored ) ||
1282+ ( method == CompressionMethod . BZip2 ) ;
12821283 }
12831284
12841285 /// <summary>
Original file line number Diff line number Diff line change @@ -882,6 +882,10 @@ public Stream GetInputStream(long entryIndex)
882882 result = new InflaterInputStream ( result , new Inflater ( true ) ) ;
883883 break ;
884884
885+ case CompressionMethod . BZip2 :
886+ result = new BZip2 . BZip2InputStream ( result ) ;
887+ break ;
888+
885889 default :
886890 throw new ZipException ( "Unsupported compression method " + method ) ;
887891 }
@@ -2580,6 +2584,14 @@ private Stream GetOutputStream(ZipEntry entry)
25802584 result = dos ;
25812585 break ;
25822586
2587+ case CompressionMethod . BZip2 :
2588+ var bzos = new BZip2 . BZip2OutputStream ( result )
2589+ {
2590+ IsStreamOwner = false
2591+ } ;
2592+ result = bzos ;
2593+ break ;
2594+
25832595 default :
25842596 throw new ZipException ( "Unknown compression method " + entry . CompressionMethod ) ;
25852597 }
You can’t perform that action at this time.
0 commit comments