BitSoft.StreamTools 1.0.0-rc.3

This is a prerelease version of BitSoft.StreamTools.
dotnet add package BitSoft.StreamTools --version 1.0.0-rc.3
                    
NuGet\Install-Package BitSoft.StreamTools -Version 1.0.0-rc.3
                    
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="BitSoft.StreamTools" Version="1.0.0-rc.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BitSoft.StreamTools" Version="1.0.0-rc.3" />
                    
Directory.Packages.props
<PackageReference Include="BitSoft.StreamTools" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BitSoft.StreamTools --version 1.0.0-rc.3
                    
#r "nuget: BitSoft.StreamTools, 1.0.0-rc.3"
                    
#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.
#:package BitSoft.StreamTools@1.0.0-rc.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BitSoft.StreamTools&version=1.0.0-rc.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=BitSoft.StreamTools&version=1.0.0-rc.3&prerelease
                    
Install as a Cake Tool

StreamTools

Yet another one library with .NET streaming helpers.

StringStream

Simple proxy stream to obrain ability process string data as a stream:

using Stream inputStream = StringStream.Read(source: "some string");

Or, you can write to a string:

using Stream outputStream = StringStream.Write();

Example

Read

For example, generate stream from a string value to compress with gZip:

using System.IO.Compression;
using BitSoft.StreamTools;

public static byte[] Compress(string source)
{
	ArgumentNullException.ThrowIfNull(source);

	using var inputStream = StringStream.Read(source);
	using var outputStream = new MemoryStream();
	using var gzipStream = new GZipStream(outputStream, CompressionMode.Compress);

	inputStream.CopyTo(gzipStream);

	return outputStream.GetBuffer();
}
Write

Decompress an input stream with gZip and convert it to a string value:

using System.IO.Compression;
using BitSoft.StreamTools;

public static string Decompress(Stream sourceStream)
{
	ArgumentNullException.ThrowIfNull(source);

	using var outputStream = StringStream.Write();
	using var gZipStream = new GZipStream(sourceStream, CompressionMode.Decompress, leaveOpen: true);

	gZipStream.CopyTo(outputStream);

	return outputStream.GetString();
}

Additional info

Please, visit https://github.com/bitc0der/BitSoft.StreamTools

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

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-rc.3 128 12/14/2024
1.0.0-rc.2 75 11/23/2024
1.0.0-rc.1 71 10/21/2024