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