Class GzJsonCacheSerializer
Implements the ICacheSerializer
contract using Newtonsoft.Json
and the GZipStream loseless compression.
Inherited Members
Namespace:CacheManager.Serialization.Json
Assembly:CacheManager.Serialization.Json.dll
Syntax
public class GzJsonCacheSerializer : JsonCacheSerializer, ICacheSerializer
Constructors
| Improve this Doc View SourceGzJsonCacheSerializer()
Initializes a new instance of the GzJsonCacheSerializer class.
Declaration
public GzJsonCacheSerializer()
GzJsonCacheSerializer(JsonSerializerSettings, JsonSerializerSettings)
Initializes a new instance of the GzJsonCacheSerializer class. With this overload the settings for de-/serialization can be set independently.
Declaration
public GzJsonCacheSerializer(JsonSerializerSettings serializationSettings, JsonSerializerSettings deserializationSettings)
Parameters
Type | Name | Description |
---|---|---|
Newtonsoft.Json.JsonSerializerSettings | serializationSettings | The settings which should be used during serialization. |
Newtonsoft.Json.JsonSerializerSettings | deserializationSettings | The settings which should be used during deserialization. |
Methods
| Improve this Doc View SourceCompression(Byte[])
Compress the serialized data using GZipStream.
Declaration
protected virtual byte[] Compression(byte[] data)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The data which should be compressed. |
Returns
Type | Description |
---|---|
System.Byte[] | The compressed data. |
Decompression(Byte[])
Decompress the compressedData into the base serialized data.
Declaration
protected virtual byte[] Decompression(byte[] compressedData)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | compressedData | The data which should be decompressed. |
Returns
Type | Description |
---|---|
System.Byte[] | The uncompressed data. |
Deserialize(Byte[], Type)
Declaration
public override object Deserialize(byte[] data, Type target)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | |
Type | target |
Returns
Type | Description |
---|---|
Object |
Overrides
| Improve this Doc View SourceSerialize<T>(T)
Declaration
public override byte[] Serialize<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value |
Returns
Type | Description |
---|---|
System.Byte[] |
Type Parameters
Name | Description |
---|---|
T |
Overrides
CacheManager.Serialization.Json.JsonCacheSerializer.Serialize<T>(T)