Class JsonGZipSerialization
- Namespace
- Arc4u.Serializer
- Assembly
- Arc4u.Serializer.JSon.dll
Implement object serialization with Json and GZip compression (https://en.wikipedia.org/wiki/Gzip).
public class JsonGZipSerialization : JsonCompressedStreamSerialization, IObjectSerialization
- Inheritance
-
JsonGZipSerialization
- Implements
- Inherited Members
Constructors
JsonGZipSerialization()
Construct an instance with default options
[RequiresUnreferencedCode("This constructor is not suitable for AOT. Use the constructor with JsonSerializerContext for AOT compatibility.")]
public JsonGZipSerialization()
JsonGZipSerialization(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 JsonGZipSerialization(JsonSerializerOptions options)
Parameters
optionsJsonSerializerOptionsJson serializer options
JsonGZipSerialization(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 JsonGZipSerialization(JsonSerializerContext context)
Parameters
contextJsonSerializerContextJson 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
Methods
CreateForCompression(Stream)
Wraps the stream in a compression stream. The underlying stream must be left open.
protected override Stream CreateForCompression(Stream stream)
Parameters
streamStreamThe 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
streamStreamThe stream that contains the compressed data.
Returns
- Stream
The decompression stream.