Class BinaryObjectEncoder
java.lang.Object
org.identityconnectors.framework.impl.serializer.binary.BinaryObjectEncoder
- All Implemented Interfaces:
BinaryObjectSerializer,ObjectEncoder
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intVersion for the overall encoding - if we need to change anything in the encoder, we will need to bump this and handle appropriatelystatic final bytestatic final bytestatic final bytestatic final intstatic final bytestatic final bytestatic final byte -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underylying stream after first flushing it.voidflush()Flushes the underlying stream.voidwriteBooleanContents(boolean v) Writes the value in-line.voidwriteBooleanField(String fieldName, boolean v) Writes a boolean.voidwriteByteArrayContents(byte[] v) Special case for byte [] that uses base64 encoding for XMLvoidwriteByteContents(byte v) Writes the value in-line.voidwriteClassContents(Class<?> v) Writes the value in-line.voidwriteClassField(String fieldName, Class<?> v) Writes a Class.voidwriteDoubleContents(double v) Writes the value in-line.voidwriteDoubleField(String fieldName, double v) Writes a double.voidwriteFloatContents(float v) Writes the value in-line.voidwriteFloatField(String fieldName, float v) Writes a float.voidwriteIntContents(int v) Writes the value in-line.voidwriteIntField(String fieldName, int v) Writes an int.voidwriteLongContents(long v) Writes the value in-line.voidwriteLongField(String fieldName, long v) Writes a long.voidWrites the next object to the stream.voidwriteObjectContents(Object object) Writes a sub-objectvoidwriteObjectField(String fieldName, Object object, boolean inline) Writes an object using the appropriate serializer for that objectvoidWrites the value in-line.voidwriteStringField(String fieldName, String v) Writes a String.
-
Field Details
-
ENCODING_VERSION
public static final int ENCODING_VERSIONVersion 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
public static final int OBJECT_MAGIC- See Also:
-
OBJECT_TYPE_NULL
public static final byte OBJECT_TYPE_NULL- See Also:
-
OBJECT_TYPE_CLASS
public static final byte OBJECT_TYPE_CLASS- See Also:
-
OBJECT_TYPE_ARRAY
public static final byte OBJECT_TYPE_ARRAY- See Also:
-
FIELD_TYPE_ANONYMOUS_FIELD
public static final byte FIELD_TYPE_ANONYMOUS_FIELD- See Also:
-
FIELD_TYPE_NAMED_FIELD
public static final byte FIELD_TYPE_NAMED_FIELD- See Also:
-
FIELD_TYPE_END_OBJECT
public static final byte FIELD_TYPE_END_OBJECT- See Also:
-
-
Constructor Details
-
BinaryObjectEncoder
-
-
Method Details
-
flush
public void flush()Description copied from interface:BinaryObjectSerializerFlushes the underlying stream.- Specified by:
flushin interfaceBinaryObjectSerializer
-
close
public void close()Description copied from interface:BinaryObjectSerializerCloses the underylying stream after first flushing it.- Specified by:
closein interfaceBinaryObjectSerializer
-
writeObject
Description copied from interface:BinaryObjectSerializerWrites the next object to the stream.- Specified by:
writeObjectin interfaceBinaryObjectSerializer- Parameters:
o- The object to write.- See Also:
-
writeBooleanContents
public void writeBooleanContents(boolean v) Description copied from interface:ObjectEncoderWrites the value in-line.- Specified by:
writeBooleanContentsin interfaceObjectEncoder
-
writeBooleanField
Description copied from interface:ObjectEncoderWrites a boolean.- Specified by:
writeBooleanFieldin interfaceObjectEncoder- Parameters:
fieldName- A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serializationv- The value to serialize
-
writeByteContents
public void writeByteContents(byte v) Description copied from interface:ObjectEncoderWrites the value in-line.- Specified by:
writeByteContentsin interfaceObjectEncoder
-
writeByteArrayContents
public void writeByteArrayContents(byte[] v) Description copied from interface:ObjectEncoderSpecial case for byte [] that uses base64 encoding for XML- Specified by:
writeByteArrayContentsin interfaceObjectEncoder
-
writeClassContents
Description copied from interface:ObjectEncoderWrites the value in-line.- Specified by:
writeClassContentsin interfaceObjectEncoder
-
writeClassField
Description copied from interface:ObjectEncoderWrites a Class.- Specified by:
writeClassFieldin interfaceObjectEncoder- Parameters:
fieldName- A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serializationv- The value to serialize
-
writeDoubleContents
public void writeDoubleContents(double v) Description copied from interface:ObjectEncoderWrites the value in-line.- Specified by:
writeDoubleContentsin interfaceObjectEncoder
-
writeDoubleField
Description copied from interface:ObjectEncoderWrites a double.- Specified by:
writeDoubleFieldin interfaceObjectEncoder- Parameters:
fieldName- A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serializationv- The value to serialize
-
writeFloatContents
public void writeFloatContents(float v) Description copied from interface:ObjectEncoderWrites the value in-line.- Specified by:
writeFloatContentsin interfaceObjectEncoder
-
writeFloatField
Description copied from interface:ObjectEncoderWrites a float.- Specified by:
writeFloatFieldin interfaceObjectEncoder- Parameters:
fieldName- A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serializationv- The value to serialize
-
writeIntContents
public void writeIntContents(int v) Description copied from interface:ObjectEncoderWrites the value in-line.- Specified by:
writeIntContentsin interfaceObjectEncoder
-
writeIntField
Description copied from interface:ObjectEncoderWrites an int.- Specified by:
writeIntFieldin interfaceObjectEncoder- Parameters:
fieldName- A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serializationv- The value to serialize
-
writeLongContents
public void writeLongContents(long v) Description copied from interface:ObjectEncoderWrites the value in-line.- Specified by:
writeLongContentsin interfaceObjectEncoder
-
writeLongField
Description copied from interface:ObjectEncoderWrites a long.- Specified by:
writeLongFieldin interfaceObjectEncoder- Parameters:
fieldName- A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serializationv- The value to serialize
-
writeObjectContents
Description copied from interface:ObjectEncoderWrites a sub-object- Specified by:
writeObjectContentsin interfaceObjectEncoder- Parameters:
object- The object to write
-
writeObjectField
Description copied from interface:ObjectEncoderWrites an object using the appropriate serializer for that object- Specified by:
writeObjectFieldin interfaceObjectEncoder- Parameters:
fieldName- A hint of the field name. Ignored for binary serialization. Becomes the subelement name for xml serializationobject- The object to serializeinline- Ignore for binary serialization. For xml serialization, this causes us not to have a sub-element. When inlining, polymorphic typing is not supported.
-
writeStringContents
Description copied from interface:ObjectEncoderWrites the value in-line.- Specified by:
writeStringContentsin interfaceObjectEncoder
-
writeStringField
Description copied from interface:ObjectEncoderWrites a String.- Specified by:
writeStringFieldin interfaceObjectEncoder- Parameters:
fieldName- A hint of the field name. Ignored for binary serialization. Becomes the attribute name for xml serializationv- The value to serialize
-