Class CharSerializer
Type serializer for the char primitive (UTF-16 code unit). Writes and reads a single character token without additional framing. The underlying writer/reader implementation is responsible for encoding the character appropriately (e.g., as a single-character JSON string).
Inherited Members
Namespace: Scylla.Core.Util.Serialization
Assembly: ScyllaCore.dll
Syntax
public sealed class CharSerializer : TypeSerializerBase<char>, ITypeSerializer<char>, ITypeSerializer
Remarks
Use the shared Instance singleton rather than creating new instances;
CharSerializer carries no mutable state and is safe to share across threads.
Fields
Instance
Shared, reusable singleton instance of CharSerializer.
Prefer this over allocating a new instance wherever a CharSerializer is needed.
Declaration
public static readonly CharSerializer Instance
Field Value
| Type | Description |
|---|---|
| CharSerializer |
Methods
Read(IScyllaReader, ISerializationContext)
Reads a single character value from the reader via ReadChar().
Declaration
public override char Read(IScyllaReader reader, ISerializationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| IScyllaReader | reader | The reader positioned at a character token. Never |
| ISerializationContext | context | The active serialization context. Never |
Returns
| Type | Description |
|---|---|
| char | The deserialized character value. |
Overrides
Write(char, IScyllaWriter, ISerializationContext)
Writes a single character value to the output via WriteChar(char).
Declaration
public override void Write(char value, IScyllaWriter writer, ISerializationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| char | value | The character to serialize. |
| IScyllaWriter | writer | The writer that receives the serialized token. Never |
| ISerializationContext | context | The active serialization context. Never |