akka.serialization
Interface Serializer

All Known Implementing Classes:
ByteArraySerializer, ClusterMessageSerializer, DaemonMsgCreateSerializer, DistributedPubSubMessageSerializer, JavaSerializer, JSerializer, MessageContainerSerializer, MessageSerializer, NullSerializer, NullSerializer$, ProtobufSerializer, SnapshotSerializer

public interface Serializer

A Serializer represents a bimap between an object and an array of bytes representing that object.

Serializers are loaded using reflection during ActorSystem start-up, where two constructors are tried in order:

Be sure to always use the PropertyManager for loading classes! This is necessary to avoid strange match errors and inequalities which arise from different class loaders loading the same class.


Method Summary
 java.lang.Object fromBinary(byte[] bytes)
          Java API: deserialize without type hint
 java.lang.Object fromBinary(byte[] bytes, java.lang.Class<?> clazz)
          Java API: deserialize with type hint
 java.lang.Object fromBinary(byte[] bytes, scala.Option<java.lang.Class<?>> manifest)
          Produces an object from an array of bytes, with an optional type-hint; the class should be loaded using ActorSystem.dynamicAccess.
 int identifier()
          Completely unique value to identify this implementation of Serializer, used to optimize network traffic Values from 0 to 16 is reserved for Akka internal usage
 boolean includeManifest()
          Returns whether this serializer needs a manifest in the fromBinary method
 byte[] toBinary(java.lang.Object o)
          Serializes the given object into an Array of Byte
 

Method Detail

identifier

int identifier()
Completely unique value to identify this implementation of Serializer, used to optimize network traffic Values from 0 to 16 is reserved for Akka internal usage

Returns:
(undocumented)

toBinary

byte[] toBinary(java.lang.Object o)
Serializes the given object into an Array of Byte

Parameters:
o - (undocumented)
Returns:
(undocumented)

includeManifest

boolean includeManifest()
Returns whether this serializer needs a manifest in the fromBinary method

Returns:
(undocumented)

fromBinary

java.lang.Object fromBinary(byte[] bytes,
                            scala.Option<java.lang.Class<?>> manifest)
Produces an object from an array of bytes, with an optional type-hint; the class should be loaded using ActorSystem.dynamicAccess.

Parameters:
bytes - (undocumented)
manifest - (undocumented)
Returns:
(undocumented)

fromBinary

java.lang.Object fromBinary(byte[] bytes)
Java API: deserialize without type hint

Parameters:
bytes - (undocumented)
Returns:
(undocumented)

fromBinary

java.lang.Object fromBinary(byte[] bytes,
                            java.lang.Class<?> clazz)
Java API: deserialize with type hint

Parameters:
bytes - (undocumented)
clazz - (undocumented)
Returns:
(undocumented)