VersaTul.Compression 1.0.16

Prefix Reserved
dotnet add package VersaTul.Compression --version 1.0.16                
NuGet\Install-Package VersaTul.Compression -Version 1.0.16                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VersaTul.Compression" Version="1.0.16" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VersaTul.Compression --version 1.0.16                
#r "nuget: VersaTul.Compression, 1.0.16"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install VersaTul.Compression as a Cake Addin
#addin nuget:?package=VersaTul.Compression&version=1.0.16

// Install VersaTul.Compression as a Cake Tool
#tool nuget:?package=VersaTul.Compression&version=1.0.16                

VersaTul Compression

The VersaTul Compression project provides functionality to compress and decompress streams. It is built around the .NET System.IO.Compression classes, making it easy to work with compressed data. Let's dive into the details:

Features

  1. Stream Compression: The project enables you to compress and decompress streams efficiently. It uses the built-in ZipStream class to quickly compress MemoryStreams into archive streams.

Usage

To use the VersaTul Compression project, follow these steps:

  1. Install the Package: You can install the VersaTul.Compression package from NuGet using the following command:

    PM> NuGet\Install-Package VersaTul.Compression --version 1.0.14
    
  2. Create a Compressed Stream:

    • Use the ZipStream class to compress a MemoryStream containing your data.
    • The compressed stream can be stored or transmitted efficiently.
  3. Decompress the Stream:

    • When needed, decompress the stream using the same ZipStream class.
    • Retrieve the original data from the decompressed stream.

Example

Here's a simple example of compressing and decompressing a stream:

using System.IO;
using VersaTul.Compression;

class Program
{
    static void Main()
    {
        // Create some sample data
        byte[] originalData = Encoding.UTF8.GetBytes("Hello, this is some data to compress!");

        // Compress the data
        using (var compressedStream = new MemoryStream())
        {
            using (var zipStream = new ZipStream(compressedStream, CompressionMode.Compress))
            {
                zipStream.Write(originalData, 0, originalData.Length);
            }

            // Store or transmit the compressed stream
            // ...

            // Decompress the stream
            using (var decompressedStream = new MemoryStream())
            {
                using (var unzipStream = new ZipStream(compressedStream, CompressionMode.Decompress))
                {
                    unzipStream.CopyTo(decompressedStream);
                }

                // Retrieve the original data
                byte[] decompressedData = decompressedStream.ToArray();
                string originalText = Encoding.UTF8.GetString(decompressedData);
                Console.WriteLine($"Decompressed data: {originalText}");
            }
        }
    }
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

Product 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 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on VersaTul.Compression:

Package Downloads
VersaTul.Collection.Streamers

The VersaTul Collection Streamers provides functionality that enables developers to quickly convert a collection of objects in memory into a data-reader that can be used for Bulk inserting data into a SQL Database, or be used to generate flat files. Developers can use the streamers to: 1. Convert a Collection to a Data-Reader. 2. Convert from a Data-Reader to other file formats such as CSV, TAB or Json. 3. Compress converted data into Zip files. 4. Transport the converted data via e-mail. The Streamers project also works with Display Attributes which is used to manipulate the properties on the objects in the collection such as formatting the data or renaming the property with a desired display name.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.16 95 12/10/2024
1.0.15 322 3/1/2024
1.0.14 150 2/2/2024
1.0.13 120 2/2/2024
1.0.12 120 2/1/2024
1.0.11 180 1/25/2024
1.0.10 130 1/23/2024
1.0.9 133 1/23/2024
1.0.8 176 1/11/2024
1.0.7 148 1/11/2024
1.0.6 175 12/16/2023
1.0.5 275 7/22/2023