Class BSONCachedValue
BSONCachedValue may be used to cache any other BSONValue and to be used in place of it. Cached BSONValue will be pre-serialized to byte array and helps to save serialization time. When decoded it will be deserialized as a cached BSONValue. There no need for additional handling on receiving side.
Implements
System.IEquatable<BSONValue>
Inherited Members
Namespace: Eco.Shared.Serialization
Assembly: Eco.Shared.dll
Syntax
public class BSONCachedValue : BSONValue, IEquatable<BSONValue>
Methods
Cache(BSONValue)
Encodes value
to binary form and saves it to Eco.Shared.Serialization.BSONCachedValue.CachedBytes. Returned BSONCachedValue can't be modified. Cached value will be recycled!
Declaration
public static BSONCachedValue Cache(BSONValue value)
Parameters
Type | Name | Description |
---|---|---|
BSONValue | value |
Returns
Type | Description |
---|---|
BSONCachedValue |
Recycle()
Recycle does nothing, because usually cached value shared between multiple BSON objects.
Declaration
public override void Recycle()
Overrides
Implements
System.IEquatable<>