|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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:
ExtendedActorSystem
;
this should be the preferred one because all reflective loading of classes
during deserialization should use ExtendedActorSystem.dynamicAccess (see
DynamicAccess
), andBe 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 |
---|
int identifier()
byte[] toBinary(java.lang.Object o)
o
- (undocumented)
boolean includeManifest()
java.lang.Object fromBinary(byte[] bytes, scala.Option<java.lang.Class<?>> manifest)
bytes
- (undocumented)manifest
- (undocumented)
java.lang.Object fromBinary(byte[] bytes)
bytes
- (undocumented)
java.lang.Object fromBinary(byte[] bytes, java.lang.Class<?> clazz)
bytes
- (undocumented)clazz
- (undocumented)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |