Soss.Client.ConcurrentCustomSerializerT
Soss.Client.ConcurrentDefaultSerializerT
Namespace: Soss.Client.Concurrent
Assembly: soss_namedcache (in soss_namedcache.dll) Version: 6.2.0.0
Type Parameters
- T
- The type of the object to be serialized.
The CustomSerializerT type exposes the following members.
Name | Description | |
---|---|---|
CustomSerializerT | Initializes a new instance of the CustomSerializerT class |
Name | Description | |
---|---|---|
Deserialize |
Deserializes an object previously serialized with Serialize(Stream, T) method
from the supplied stream.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetObjectType |
Returns a type of the object.
| |
GetSize |
Returns the size of fixed size objects.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Serialize |
Serializes an object into a Stream.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
By default NamedMapTKey, TValue uses Microsoft BinaryFormatter serializer, so it's important for the key and value types to be marked as Serializable. Using a CustomSerializer is advisable when implementing portable Java/C# objects or when you would like to get advantage of some high-performance serializers.
If serialization or deserialization of an object is not supported in its implementation, it should throw an NotSupportedException. This will trigger an attempt to fallback to standard serialization. However, it is not recommended to keep such objects in the cache when a custom serializer is defined. You can use a "magic number" in the beginning of the stream to distinguish custom serialized objects from ones using a standard serialization (based on the BinaryFormatter serializer).