Interface ICompactSerializable
Implementations of ICompactSerializable can add their state directly to the output stream, enabling them to bypass costly serialization.
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
[CLSCompliant(false)]
public interface ICompactSerializable
Remarks
Objects that implement ICompactSerializable must have a default constructor (can be private).
As per current implementation when a ICompactSerializable is deserialized the default constructor is not invoked, therefore the object must "construct" itself in Deserialize(CompactReader).
Methods
Deserialize(CompactReader)
Load the state from the passed stream reader object.
Declaration
[CLSCompliant(false)]
void Deserialize(CompactReader reader)
Parameters
Type | Name | Description |
---|---|---|
CompactReader | reader | An object of class CompactReader. |
Remarks
As per current implementation when a ICompactSerializable is deserialized the default constructor is not invoked, therefore the object must "construct" itself in Deserialize(CompactReader).
Serialize(CompactWriter)
Save the state to the passed stream reader object.
Declaration
[CLSCompliant(false)]
void Serialize(CompactWriter writer)
Parameters
Type | Name | Description |
---|---|---|
CompactWriter | writer | An object of class CompactWriter. |