Class DecimalSerializer
Deprecated: this class will be made internal in the next major version.
Inherited Members
Namespace: Cassandra.Serialization.Primitive
Assembly: Cassandra.dll
Syntax
public class DecimalSerializer : TypeSerializer<decimal>
Properties
CqlType
Returns the Cassandra data type for the serializer.
Declaration
public override ColumnTypeCode CqlType { get; }
Property Value
| Type | Description |
|---|---|
| ColumnTypeCode |
Overrides
Methods
Deserialize(ushort, byte[], int, int, IColumnInfo)
When overridden from a derived class, it reads the byte buffer and returns the CLR representation of the data type.
Declaration
public override decimal Deserialize(ushort protocolVersion, byte[] buffer, int offset, int length, IColumnInfo typeInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort | protocolVersion | The Cassandra native protocol version. |
| byte[] | buffer | The byte array. |
| int | offset | The zero-based byte offset in buffer at which to begin storing data from the current stream. |
| int | length | The maximum amount of bytes to read from buffer. |
| IColumnInfo | typeInfo | Additional type information designed for non-primitive types. |
Returns
| Type | Description |
|---|---|
| decimal |
Overrides
Serialize(ushort, decimal)
When overridden from a derived class, it encodes the CLR object into the byte representation according to the Cassandra native protocol.
Declaration
public override byte[] Serialize(ushort protocolVersion, decimal value)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort | protocolVersion | The Cassandra native protocol version. |
| decimal | value | The object to encode. |
Returns
| Type | Description |
|---|---|
| byte[] |