Class NullSerializer

java.lang.Object
org.apache.pekko.serialization.NullSerializer
All Implemented Interfaces:
Serializer
Direct Known Subclasses:
NullSerializer$

public class NullSerializer extends Object implements Serializer
This is a special Serializer that Serializes and deserializes nulls only
  • Constructor Details

    • NullSerializer

      public NullSerializer()
  • Method Details

    • nullAsBytes

      public byte[] nullAsBytes()
    • includeManifest

      public boolean includeManifest()
      Description copied from interface: Serializer
      Returns whether this serializer needs a manifest in the fromBinary method
      Specified by:
      includeManifest in interface Serializer
    • identifier

      public int identifier()
      Description copied from interface: Serializer
      Completely unique value to identify this implementation of Serializer, used to optimize network traffic. Values from 0 to 40 are reserved for Pekko internal usage.
      Specified by:
      identifier in interface Serializer
    • toBinary

      public byte[] toBinary(Object o)
      Description copied from interface: Serializer
      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.

      Specified by:
      toBinary in interface Serializer
    • fromBinary

      public Object fromBinary(byte[] bytes, scala.Option<Class<?>> clazz) throws NotSerializableException
      Description copied from interface: Serializer
      Produces an object from an array of bytes, with an optional type-hint; the class should be loaded using ActorSystem.dynamicAccess.
      Specified by:
      fromBinary in interface Serializer
      Throws:
      NotSerializableException