Search Results for

    Show / Hide Table of Contents

    Class ByteArraySerializer

    This is a special Serializer that serializes and deserializes byte arrays only. Legacy byte-array APIs return the supplied array unchanged.

    Inheritance
    object
    Serializer
    SerializerV2
    ByteArraySerializer
    Inherited Members
    SerializerV2.UnknownSize
    SerializerV2.IncludeManifest
    Serializer.system
    Serializer.Identifier
    Serializer.ToBinaryWithAddress(Address, object)
    Serializer.FromBinary<T>(byte[])
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Serialization
    Assembly: Akka.dll
    Syntax
    public class ByteArraySerializer : SerializerV2

    Constructors

    | Edit this page View Source

    ByteArraySerializer(ExtendedActorSystem)

    Initializes a new instance of the ByteArraySerializer class.

    Declaration
    public ByteArraySerializer(ExtendedActorSystem system)
    Parameters
    Type Name Description
    ExtendedActorSystem system

    The actor system to associate with this serializer.

    Methods

    | Edit this page View Source

    Deserialize(ReadOnlySequence<byte>, string)

    Deserializes bytes into a byte array.

    Declaration
    public override object Deserialize(ReadOnlySequence<byte> bytes, string manifest)
    Parameters
    Type Name Description
    ReadOnlySequence<byte> bytes
    string manifest
    Returns
    Type Description
    object
    Overrides
    SerializerV2.Deserialize(ReadOnlySequence<byte>, string)
    | Edit this page View Source

    FromBinary(byte[], string)

    Deserializes a byte array without copying for legacy compatibility callers.

    Declaration
    public override object FromBinary(byte[] bytes, string manifest)
    Parameters
    Type Name Description
    byte[] bytes
    string manifest
    Returns
    Type Description
    object
    Overrides
    SerializerV2.FromBinary(byte[], string)
    | Edit this page View Source

    FromBinary(byte[], Type)

    Deserializes a byte array into an object of type type.

    Declaration
    public override object FromBinary(byte[] bytes, Type type)
    Parameters
    Type Name Description
    byte[] bytes

    The array containing the serialized object

    Type type

    The type of object contained in the array

    Returns
    Type Description
    object

    The object contained in the array

    Overrides
    SerializerV2.FromBinary(byte[], Type)
    | Edit this page View Source

    Manifest(object)

    Byte arrays preserve their legacy empty manifest for wire compatibility.

    Declaration
    public override string Manifest(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    string
    Overrides
    SerializerV2.Manifest(object)
    | Edit this page View Source

    Serialize(object, IBufferWriter<byte>)

    Serializes the given byte array directly into writer.

    Declaration
    public override int Serialize(object obj, IBufferWriter<byte> writer)
    Parameters
    Type Name Description
    object obj
    IBufferWriter<byte> writer
    Returns
    Type Description
    int
    Overrides
    SerializerV2.Serialize(object, IBufferWriter<byte>)
    | Edit this page View Source

    SizeHint(object)

    Returns the exact byte array length when obj is a byte array.

    Declaration
    public override int SizeHint(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    int
    Overrides
    SerializerV2.SizeHint(object)
    | Edit this page View Source

    ToBinary(object)

    Serializes the given object into a byte array

    Declaration
    public override byte[] ToBinary(object obj)
    Parameters
    Type Name Description
    object obj

    The object to serialize

    Returns
    Type Description
    byte[]

    A byte array containing the serialized object

    Overrides
    SerializerV2.ToBinary(object)
    Exceptions
    Type Condition
    NotSupportedException

    This exception is thrown if the given obj is not a byte array.

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET