<PackageReference Include="BouncyCastle.Cryptography" Version="2.3.1" />

Zip

static class Zip
using Org.BouncyCastle.Utilities.Zlib; using System.IO; namespace Org.BouncyCastle.Utilities.IO.Compression { internal static class Zip { internal static Stream CompressOutput(Stream stream, int zlibCompressionLevel, bool leaveOpen = false) { if (!leaveOpen) return new ZOutputStream(stream, zlibCompressionLevel, true); return new ZOutputStreamLeaveOpen(stream, zlibCompressionLevel, true); } internal static Stream DecompressInput(Stream stream, bool leaveOpen = false) { if (!leaveOpen) return new ZInputStream(stream, true); return new ZInputStreamLeaveOpen(stream, true); } } }