Class ByteArraySerializer

java.lang.Object
de.iip_ecosphere.platform.transport.serialization.ByteArraySerializer
All Implemented Interfaces:
InputTypeTranslator<byte[],byte[]>, OutputTypeTranslator<byte[],byte[]>, Serializer<byte[]>, TypeTranslator<byte[],byte[]>

public class ByteArraySerializer extends Object implements Serializer<byte[]>
A default serializer for byte[].
Author:
Holger Eichelberger, SSE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    clone(byte[] origin)
    Creates a new value instance and copies the values from origin to the new instance.
    byte[]
    from(byte[] data)
    Deserializes a target value into a source value ("input from external").
    Class<byte[]>
    The type to be handled by this serializer.
    byte[]
    to(byte[] source)
    Translates a source value into a target value ("output to external").

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteArraySerializer

      public ByteArraySerializer()
  • Method Details

    • from

      public byte[] from(byte[] data) throws IOException
      Description copied from interface: InputTypeTranslator
      Deserializes a target value into a source value ("input from external").
      Specified by:
      from in interface InputTypeTranslator<byte[],byte[]>
      Parameters:
      data - the data to be translated back
      Returns:
      the serialized object
      Throws:
      IOException - in case that serialization fails
    • to

      public byte[] to(byte[] source) throws IOException
      Description copied from interface: OutputTypeTranslator
      Translates a source value into a target value ("output to external").
      Specified by:
      to in interface OutputTypeTranslator<byte[],byte[]>
      Parameters:
      source - the source value to be translated
      Returns:
      the target value
      Throws:
      IOException - in case that translation fails
    • clone

      public byte[] clone(byte[] origin) throws IOException
      Description copied from interface: Serializer
      Creates a new value instance and copies the values from origin to the new instance. Use the SerializerRegistry to implement cloning of nested object values.
      Specified by:
      clone in interface Serializer<byte[]>
      Parameters:
      origin - the object to clone
      Returns:
      the cloned object
      Throws:
      IOException - in case that cloning/serialization operations fail
    • getType

      public Class<byte[]> getType()
      Description copied from interface: Serializer
      The type to be handled by this serializer.
      Specified by:
      getType in interface Serializer<byte[]>
      Returns:
      the type