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