Table of Contents

Class JsonDeflateSerialization

Namespace
Arc4u.Serializer
Assembly
Arc4u.Serializer.JSon.dll

Implement object serialization with Json and Deflate compression (https://en.wikipedia.org/wiki/Deflate).

public class JsonDeflateSerialization : JsonCompressedStreamSerialization, IObjectSerialization
Inheritance
JsonDeflateSerialization
Implements
Inherited Members

Constructors

JsonDeflateSerialization()

Construct an instance with default options

[RequiresUnreferencedCode("This constructor is not suitable for AOT. Use the constructor with JsonSerializerContext for AOT compatibility.")]
public JsonDeflateSerialization()

JsonDeflateSerialization(JsonSerializerOptions)

Construct an instance, with specific serializer options

[RequiresUnreferencedCode("This constructor is not suitable for AOT. Use the constructor with JsonSerializerContext for AOT compatibility.")]
public JsonDeflateSerialization(JsonSerializerOptions options)

Parameters

options JsonSerializerOptions

Json serializer options.

JsonDeflateSerialization(JsonSerializerContext)

Construct an instance with a serialization context. This is used for source generation, implemented in .NET 6 or later (https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/source-generation?pivots=dotnet-6-0)

public JsonDeflateSerialization(JsonSerializerContext context)

Parameters

context JsonSerializerContext

Json context for source generation.

Properties

SerializerType

Gets the value written in the SerializerType tag of the current Activity.

protected override string SerializerType { get; }

Property Value

string

Methods

CreateForCompression(Stream)

Wraps the stream in a compression stream. The underlying stream must be left open.

protected override Stream CreateForCompression(Stream stream)

Parameters

stream Stream

The stream that receives the compressed data.

Returns

Stream

The compression stream.

CreateForDecompression(Stream)

Wraps the stream in a decompression stream.

protected override Stream CreateForDecompression(Stream stream)

Parameters

stream Stream

The stream that contains the compressed data.

Returns

Stream

The decompression stream.