CommonNetFuncs.Compression
1.0.42
See the version list below for details.
dotnet add package CommonNetFuncs.Compression --version 1.0.42
NuGet\Install-Package CommonNetFuncs.Compression -Version 1.0.42
<PackageReference Include="CommonNetFuncs.Compression" Version="1.0.42" />
<PackageVersion Include="CommonNetFuncs.Compression" Version="1.0.42" />
<PackageReference Include="CommonNetFuncs.Compression" />
paket add CommonNetFuncs.Compression --version 1.0.42
#r "nuget: CommonNetFuncs.Compression, 1.0.42"
#:package CommonNetFuncs.Compression@1.0.42
#addin nuget:?package=CommonNetFuncs.Compression&version=1.0.42
#tool nuget:?package=CommonNetFuncs.Compression&version=1.0.42
CommonNetFuncs.Compression
This project contains helper methods for compressing files into a zip file as well as compress and decompress streams.
Contents
Files
Used for compressing file data into a ZipArchive class.
<details> <summary><h3>Usage Examples</h3></summary>
Add file to zip folder and write it to disk.
using static CommonNetFuncs.Compression.Files;
using static CommonNetFuncs.Excel.Npoi.Export;
public async Task CreatePeopleZipFile()
{
List<Person> people = [];
//Some code populating people list here
await using MemoryStream zipStream = new();
//Converts list to excel file in a MemoryStream (see Excel.Npoi)
await using MemoryStream peopleExcelStream = await people.GenericExcelExport() ?? new();
await (peopleExcelStream, "People.xlsx").ZipFile(zipStream, CompressionLevel.SmallestSize);
peopleExcelStream.Dispose();
zipStream.Position = 0;
//Write the zip file to disk
await using FileStream fs = new("People.zip", FileMode.Create, FileAccess.Write);
await zipStream.CopyToAsync(fs);
fs.Flush();
}
Add multiple files to a ZipArchive object and write it to disk.
public async Task CreatePeopleAndAddressesZipFile()
{
List<Person> people = [];
List<Address> addresses = [];
//Some code populating people and addresses lists here
await using MemoryStream zipStream = new();
using ZipArchive archive = new(zipStream, ZipArchiveMode.Create, true);
//Convert lists to excel file in a MemoryStream (see Excel.Npoi) then add them to a ZipArchive
await using MemoryStream peopleExcelStream = await people.GenericExcelExport() ?? new();
await peopleExcelStream.AddFileToZip(archive, "People.xlsx", CompressionLevel.SmallestSize);
peopleExcelStream.Dispose();
await using MemoryStream addressesExcelStream = await addresses.GenericExcelExport() ?? new();
await addressesExcelStream.AddFileToZip(archive, "Addresses.xlsx", CompressionLevel.SmallestSize);
addressesExcelStream.Dispose();
archive.Dispose();
await using FileStream fs = new("PeopleAndAddresses.zip", FileMode.Create, FileAccess.Write);
await zipStream.CopyToAsync(fs);
fs.Flush();
}
</details>
Streams
Used for compressing and decompressing streams of data. Currently supported compression algorithms:
- Brotli
- GZip
- Deflate
- ZLib
<details> <summary><h3>Usage Examples</h3></summary>
Compress and then decompress a stream. CommonNetFuncs.Web.Requests has a more practical implementation decompressing compressed API responses.
public async Task CompressAndDecompressFile()
{
//Create stream
await using FileStream fileStream = new("TestFile.txt", FileMode.Open, FileAccess.Read);
//Compress the stream
await using MemoryStream compressedStream = new();
await fileStream.DecompressStream(compressedStream, ECompressionType.Gzip);
//Decompress the stream
await using MemoryStream decompressedStream = new();
await compressedStream.DecompressStream(decompressedStream, ECompressionType.Gzip);
}
</details>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- CommonNetFuncs.Core (>= 1.0.42)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on CommonNetFuncs.Compression:
| Package | Downloads |
|---|---|
|
CommonNetFuncs.Web.Aws.S3
Helper methods that deal with AWS S3 interactions |
|
|
CommonNetFuncs.Web.Requests
Helper methods that deal with creating, sending, and handling the responses from REST API calls |
|
|
CommonNetFuncs.Web.Common
Helper methods that deal with general web applications. |
|
|
CommonNetFuncs.Web.Middleware
Misc middleware for ASP.NET MVC applications |
|
|
CommonNetFuncs.Email
Helper methods that deal with sending email, including an SMTP email sending service and an HTML email builder helper. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1 | 51 | 11/27/2025 |
| 4.0.0 | 141 | 11/23/2025 |
| 3.8.18 | 477 | 11/20/2025 |
| 3.8.16 | 452 | 11/17/2025 |
| 3.8.13 | 336 | 11/10/2025 |
| 3.8.4 | 371 | 10/9/2025 |
| 3.7.17 | 433 | 9/11/2025 |
| 3.7.16 | 228 | 9/11/2025 |
| 3.7.13 | 263 | 9/8/2025 |
| 3.7.10 | 248 | 8/29/2025 |
| 3.7.8 | 608 | 8/29/2025 |
| 3.7.0 | 313 | 8/18/2025 |
| 3.6.27 | 233 | 8/18/2025 |
| 3.6.26 | 231 | 8/14/2025 |
| 3.6.25 | 238 | 8/13/2025 |
| 3.6.24 | 238 | 8/12/2025 |
| 3.6.19 | 262 | 7/28/2025 |
| 3.6.18 | 422 | 7/25/2025 |
| 3.6.13 | 514 | 7/23/2025 |
| 3.6.1 | 366 | 7/14/2025 |
| 3.6.0 | 213 | 7/11/2025 |
| 3.5.3 | 221 | 7/10/2025 |
| 3.5.0 | 262 | 7/7/2025 |
| 3.4.30 | 174 | 7/7/2025 |
| 3.4.28 | 157 | 6/27/2025 |
| 3.4.27 | 114 | 6/27/2025 |
| 3.4.24 | 176 | 6/27/2025 |
| 3.4.23 | 241 | 6/26/2025 |
| 3.4.21 | 202 | 6/26/2025 |
| 3.4.20 | 261 | 6/25/2025 |
| 3.4.18 | 239 | 6/23/2025 |
| 3.4.8 | 556 | 6/11/2025 |
| 3.4.2 | 300 | 6/2/2025 |
| 3.4.1 | 174 | 5/30/2025 |
| 3.4.0 | 231 | 5/30/2025 |
| 3.3.14 | 270 | 5/21/2025 |
| 3.3.11 | 223 | 5/18/2025 |
| 3.3.10 | 310 | 5/13/2025 |
| 3.3.9 | 275 | 5/13/2025 |
| 3.3.7 | 264 | 5/12/2025 |
| 3.3.0 | 267 | 4/29/2025 |
| 3.2.13 | 434 | 2/13/2025 |
| 3.2.9 | 164 | 2/4/2025 |
| 3.2.6 | 151 | 1/28/2025 |
| 3.2.0 | 212 | 12/19/2024 |
| 3.1.0 | 242 | 12/6/2024 |
| 3.0.0 | 176 | 12/3/2024 |
| 2.1.3 | 177 | 12/3/2024 |
| 2.1.0 | 169 | 12/2/2024 |
| 2.0.5 | 167 | 11/26/2024 |
| 2.0.2 | 177 | 11/18/2024 |
| 2.0.1 | 169 | 11/15/2024 |
| 2.0.0 | 168 | 11/14/2024 |
| 1.0.47 | 182 | 11/14/2024 |
| 1.0.42 | 206 | 11/12/2024 |
| 1.0.40 | 213 | 11/12/2024 |
| 1.0.37 | 182 | 11/4/2024 |
| 1.0.31 | 192 | 10/31/2024 |
| 1.0.28 | 187 | 10/25/2024 |
| 1.0.26 | 244 | 10/18/2024 |
| 1.0.25 | 166 | 10/17/2024 |
| 1.0.24 | 162 | 10/17/2024 |
| 1.0.18 | 203 | 10/11/2024 |
| 1.0.17 | 249 | 9/27/2024 |
| 1.0.16 | 200 | 9/27/2024 |
| 1.0.14 | 183 | 9/23/2024 |
| 1.0.13 | 192 | 9/18/2024 |
| 1.0.12 | 181 | 9/18/2024 |
| 1.0.11 | 182 | 9/18/2024 |
| 1.0.10 | 215 | 9/11/2024 |
| 1.0.9 | 191 | 9/11/2024 |
| 1.0.8 | 222 | 9/11/2024 |
| 1.0.7 | 199 | 9/11/2024 |
| 1.0.1 | 238 | 9/4/2024 |
| 1.0.0 | 204 | 9/2/2024 |