Interface Serializer

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.
      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

      • fromBinary

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

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

        java.lang.Object fromBinary​(byte[] bytes,
                                    java.lang.Class<?> clazz)
                             throws java.io.NotSerializableException
        Java API: deserialize with type hint
        Throws:
        java.io.NotSerializableException
      • identifier

        int identifier()
        Completely unique value to identify this implementation of Serializer, used to optimize network traffic. Values from 0 to 40 are reserved for Akka internal usage.
      • includeManifest

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

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

        Note that the array must not be mutated by the serializer after it has been returned.