Class BinaryObjectEncoder

java.lang.Object
org.identityconnectors.framework.impl.serializer.binary.BinaryObjectEncoder
All Implemented Interfaces:
BinaryObjectSerializer, ObjectEncoder

public class BinaryObjectEncoder extends Object implements ObjectEncoder, BinaryObjectSerializer
  • Field Details Link icon

    • ENCODING_VERSION Link icon

      public static final int ENCODING_VERSION
      Version for the overall encoding - if we need to change anything in the encoder, we will need to bump this and handle appropriately
      See Also:
    • OBJECT_MAGIC Link icon

      public static final int OBJECT_MAGIC
      See Also:
    • OBJECT_TYPE_NULL Link icon

      public static final byte OBJECT_TYPE_NULL
      See Also:
    • OBJECT_TYPE_CLASS Link icon

      public static final byte OBJECT_TYPE_CLASS
      See Also:
    • OBJECT_TYPE_ARRAY Link icon

      public static final byte OBJECT_TYPE_ARRAY
      See Also:
    • FIELD_TYPE_ANONYMOUS_FIELD Link icon

      public static final byte FIELD_TYPE_ANONYMOUS_FIELD
      See Also:
    • FIELD_TYPE_NAMED_FIELD Link icon

      public static final byte FIELD_TYPE_NAMED_FIELD
      See Also:
    • FIELD_TYPE_END_OBJECT Link icon

      public static final byte FIELD_TYPE_END_OBJECT
      See Also:
  • Constructor Details Link icon

    • BinaryObjectEncoder Link icon

      public BinaryObjectEncoder(OutputStream output)
  • Method Details Link icon

    • flush Link icon

      public void flush()
      Description copied from interface: BinaryObjectSerializer
      Flushes the underlying stream.
      Specified by:
      flush in interface BinaryObjectSerializer
    • close Link icon

      public void close()
      Description copied from interface: BinaryObjectSerializer
      Closes the underylying stream after first flushing it.
      Specified by:
      close in interface BinaryObjectSerializer
    • writeObject Link icon

      public void writeObject(Object o)
      Description copied from interface: BinaryObjectSerializer
      Writes the next object to the stream.
      Specified by:
      writeObject in interface BinaryObjectSerializer
      Parameters:
      o - The object to write.
      See Also:
    • writeBooleanContents Link icon

      public void writeBooleanContents(boolean v)
      Description copied from interface: ObjectEncoder
      Writes the value in-line.
      Specified by:
      writeBooleanContents in interface ObjectEncoder
    • writeBooleanField Link icon

      public void writeBooleanField(String fieldName, boolean v)
      Description copied from interface: ObjectEncoder
      Writes a boolean.
      Specified by:
      writeBooleanField in interface ObjectEncoder
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeByteContents Link icon

      public void writeByteContents(byte v)
      Description copied from interface: ObjectEncoder
      Writes the value in-line.
      Specified by:
      writeByteContents in interface ObjectEncoder
    • writeByteArrayContents Link icon

      public void writeByteArrayContents(byte[] v)
      Description copied from interface: ObjectEncoder
      Special case for byte [] that uses base64 encoding for XML
      Specified by:
      writeByteArrayContents in interface ObjectEncoder
    • writeClassContents Link icon

      public void writeClassContents(Class<?> v)
      Description copied from interface: ObjectEncoder
      Writes the value in-line.
      Specified by:
      writeClassContents in interface ObjectEncoder
    • writeClassField Link icon

      public void writeClassField(String fieldName, Class<?> v)
      Description copied from interface: ObjectEncoder
      Writes a Class.
      Specified by:
      writeClassField in interface ObjectEncoder
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeDoubleContents Link icon

      public void writeDoubleContents(double v)
      Description copied from interface: ObjectEncoder
      Writes the value in-line.
      Specified by:
      writeDoubleContents in interface ObjectEncoder
    • writeDoubleField Link icon

      public void writeDoubleField(String fieldName, double v)
      Description copied from interface: ObjectEncoder
      Writes a double.
      Specified by:
      writeDoubleField in interface ObjectEncoder
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeFloatContents Link icon

      public void writeFloatContents(float v)
      Description copied from interface: ObjectEncoder
      Writes the value in-line.
      Specified by:
      writeFloatContents in interface ObjectEncoder
    • writeFloatField Link icon

      public void writeFloatField(String fieldName, float v)
      Description copied from interface: ObjectEncoder
      Writes a float.
      Specified by:
      writeFloatField in interface ObjectEncoder
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeIntContents Link icon

      public void writeIntContents(int v)
      Description copied from interface: ObjectEncoder
      Writes the value in-line.
      Specified by:
      writeIntContents in interface ObjectEncoder
    • writeIntField Link icon

      public void writeIntField(String fieldName, int v)
      Description copied from interface: ObjectEncoder
      Writes an int.
      Specified by:
      writeIntField in interface ObjectEncoder
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeLongContents Link icon

      public void writeLongContents(long v)
      Description copied from interface: ObjectEncoder
      Writes the value in-line.
      Specified by:
      writeLongContents in interface ObjectEncoder
    • writeLongField Link icon

      public void writeLongField(String fieldName, long v)
      Description copied from interface: ObjectEncoder
      Writes a long.
      Specified by:
      writeLongField in interface ObjectEncoder
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize
    • writeObjectContents Link icon

      public void writeObjectContents(Object object)
      Description copied from interface: ObjectEncoder
      Writes a sub-object
      Specified by:
      writeObjectContents in interface ObjectEncoder
      Parameters:
      object - The object to write
    • writeObjectField Link icon

      public void writeObjectField(String fieldName, Object object, boolean inline)
      Description copied from interface: ObjectEncoder
      Writes an object using the appropriate serializer for that object
      Specified by:
      writeObjectField in interface ObjectEncoder
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the subelement name for xml serialization
      object - The object to serialize
      inline - Ignore for binary serialization. For xml serialization, this causes us not to have a sub-element. When inlining, polymorphic typing is not supported.
    • writeStringContents Link icon

      public void writeStringContents(String str)
      Description copied from interface: ObjectEncoder
      Writes the value in-line.
      Specified by:
      writeStringContents in interface ObjectEncoder
    • writeStringField Link icon

      public void writeStringField(String fieldName, String v)
      Description copied from interface: ObjectEncoder
      Writes a String.
      Specified by:
      writeStringField in interface ObjectEncoder
      Parameters:
      fieldName - A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serialization
      v - The value to serialize