Class ByteArraySerializer
This is a special Serializer that serializes and deserializes byte arrays only. Legacy byte-array APIs return the supplied array unchanged.
Inherited Members
Namespace: Akka.Serialization
Assembly: Akka.dll
Syntax
public class ByteArraySerializer : SerializerV2
Constructors
| Edit this page View SourceByteArraySerializer(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 SourceDeserialize(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
| Edit this page View SourceFromBinary(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
| Edit this page View SourceFromBinary(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
| Edit this page View SourceManifest(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
| Edit this page View SourceSerialize(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
| Edit this page View SourceSizeHint(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
| Edit this page View SourceToBinary(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
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | This exception is thrown if the given |
Edit this page