xdelta.Lzma 3.0.0

dotnet add package xdelta.Lzma --version 3.0.0
                    
NuGet\Install-Package xdelta.Lzma -Version 3.0.0
                    
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="xdelta.Lzma" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="xdelta.Lzma" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="xdelta.Lzma" />
                    
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 xdelta.Lzma --version 3.0.0
                    
#r "nuget: xdelta.Lzma, 3.0.0"
                    
#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 xdelta.Lzma@3.0.0
                    
#: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=xdelta.Lzma&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=xdelta.Lzma&version=3.0.0
                    
Install as a Cake Tool

xdelta.Lzma

Apply an xdelta3 patch with LZMA secondary compression in .NET 8. LzmaVcdiff also accepts uncompressed VCDIFF patches and handles a mix of raw and compressed sections across windows. The package includes the core xdelta dependency and uses SharpCompress for managed LZMA2 decoding.

dotnet add package xdelta.Lzma
using XDeltaSharp.Lzma;

const int MiB = 1024 * 1024;
using var original = File.OpenRead("original.bin");
using var patch = File.OpenRead("update.vcdiff");
using var restored = File.Create("restored.bin");
long written = LzmaVcdiff.Decode(original, patch, restored, new LzmaDecodeOptions
{
    MaxEncodedWindowBytes = 8 * MiB,
    MaxExpandedSectionBytes = 8 * MiB,
    MaxDictionaryBytes = 16 * MiB,
    MaxOutputBytes = 512L * MiB
});

For in-memory inputs, LzmaVcdiff.Decode(source, patch) returns a new target array. Pass destination.AsSpan() as the third argument to fill an existing buffer and receive the byte count.

Every decode verifies any Adler-32 window checksums. LzmaDecodeOptions extends the core VcdiffDecodeOptions, so MaxOutputBytes caps the whole output, MaxWindowBytes tightens the default 64 MiB target window limit, and MaxEncodedWindowBytes bounds each window's encoded sections before the stream decoder reads them.

LZMA uses separate streams for data, instructions, and addresses. By default each stream can expand a section to 64 MiB and retain a dictionary of up to 64 MiB across windows. MaxExpandedSectionBytes and MaxDictionaryBytes lower both limits. The example permits up to 24 MiB of expanded section contents and three declared dictionaries of up to 16 MiB each, in addition to the target, encoded input, and codec overhead. The decoder checks the declared dictionary size before starting each stream.

To verify xdelta3 BLAKE3 armor as well, reference xdelta.Blake3 and set Armor = Blake3Armor.Verify from the XDeltaSharp.Blake3 namespace. To create a patch, use the core XDeltaSharp.Vcdiff.Encode API, which writes uncompressed sections. Stream requirements and compatibility

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

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
3.0.0 102 11/28/2026
2.0.0 96 11/27/2026
1.0.1 112 11/26/2026
1.0.0 148 11/26/2026

Breaking: settings moved from optional parameters to options objects. Pass a VcdiffEncodeOptions (CompressionLevel, MemoryMode, Optimize) to Vcdiff.Encode and a VcdiffDecodeOptions (MaxOutputBytes, MaxWindowBytes, MaxEncodedWindowBytes, Armor) to Vcdiff.Decode. LzmaVcdiff.Decode takes an LzmaDecodeOptions, which adds MaxExpandedSectionBytes and MaxDictionaryBytes. DecodeWithLimits and DecodeWithSecondaryLimits are removed. Patch bytes are unchanged.