Class ShortSerializer
Type serializer for the short primitive (signed 16-bit integer, range -32,768-32,767). Writes and reads a single short token without additional framing.
Inherited Members
Namespace: Scylla.Core.Util.Serialization
Assembly: ScyllaCore.dll
Syntax
public sealed class ShortSerializer : TypeSerializerBase<short>, ITypeSerializer<short>, ITypeSerializer
Remarks
Use the shared Instance singleton rather than creating new instances;
ShortSerializer carries no mutable state and is safe to share across threads.
Fields
Instance
Shared, reusable singleton instance of ShortSerializer.
Prefer this over allocating a new instance wherever a ShortSerializer is needed.
Declaration
public static readonly ShortSerializer Instance
Field Value
| Type | Description |
|---|---|
| ShortSerializer |
Methods
Read(IScyllaReader, ISerializationContext)
Reads a signed 16-bit integer value from the reader via ReadShort().
Declaration
public override short Read(IScyllaReader reader, ISerializationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| IScyllaReader | reader | The reader positioned at a short token. Never |
| ISerializationContext | context | The active serialization context. Never |
Returns
| Type | Description |
|---|---|
| short | The deserialized short value. |
Overrides
Write(short, IScyllaWriter, ISerializationContext)
Writes a signed 16-bit integer value to the output via WriteShort(short).
Declaration
public override void Write(short value, IScyllaWriter writer, ISerializationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| short | value | The short value to serialize (-32,768-32,767). |
| IScyllaWriter | writer | The writer that receives the serialized token. Never |
| ISerializationContext | context | The active serialization context. Never |