@NotStorableClass public class HelperBinaryConversion extends Object
AbstractNullableAndTypedConverter
Constructor and Description |
---|
HelperBinaryConversion() |
Modifier and Type | Method and Description |
---|---|
int |
byteSize(byte typeRecord) |
AbstractConverter |
fromBinary(byte[] binary,
int offset)
convert binary to object taking object type in first byte ( nullable flag
and type )
|
AbstractConverter |
fromBinary(byte[] binary,
int offset,
ClassInfo classInfo)
convert binary to object
|
int |
getType(byte typeRecord) |
int |
getType(byte[] binary,
int offset) |
String |
getTypeName(int typeCode) |
void |
initialize(ClassInfoFactory classInfoFactory,
IObjectIOManagerForObjectIO objectIOManager) |
byte[] |
toBinary(boolean valueDefined,
Object object,
ClassInfo classInfo) |
int |
toBinary(byte[] binary,
int offset,
ClassInfo classInfo,
boolean valueDefined,
Object object)
convert object value to binary
|
public static final byte BYTE_TYPE
public static final byte SHORT_TYPE
public static final byte INTEGER_TYPE
public static final byte LONG_TYPE
public static final byte FLOAT_TYPE
public static final byte DOUBLE_TYPE
public static final byte BOOLEAN_TYPE
public static final byte CHARACTER_TYPE
public static final byte REFERENCE_TYPE
public static final byte NULL_TYPE
public final NullableAndTypedByteConverter nullableAndTypedByteConverter
public final ByteConverter byteConverter
public final NullableAndTypedLongConverter nullableAndTypedLongConverter
public final LongConverter longConverter
public final NullableAndTypedIntegerConverter nullableAndTypedIntegerConverter
public final IntegerConverter integerConverter
public final NullableAndTypedShortConverter nullableAndTypedShortConverter
public final ShortConverter shortConverter
public final FloatConverter floatConverter
public final NullableAndTypedFloatConverter nullableAndTypedFloatConverter
public final DoubleConverter doubleConverter
public final NullableAndTypedDoubleConverter nullableAndTypedDoubleConverter
public final NullableAndTypedBooleanConverter nullableAndTypedBooleanConverter
public final BooleanConverter booleanConverter
public final NullableAndTypedCharacterConverter nullableAndTypedCharacterConverter
public final CharacterConverter characterConverter
public final NullableAndTypedReferenceConverter nullableAndTypedReferenceConverter
public final ReferenceConverter referenceConverter
public static final NullConverter nullConverter
public static final int BOOLEAN_NULLABLE_BYTE_SIZE
public static final int BOOLEAN_BYTE_SIZE
public static final int BYTE_BYTE_SIZE
public static final int BYTE_NULLABLE_BYTE_SIZE
public static final int SHORT_NULLABLE_BYTE_SIZE
public static final int SHORT_BYTE_SIZE
public static final int INT_NULLABLE_BYTE_SIZE
public static final int INT_BYTE_SIZE
public static final int LONG_NULLABLE_BYTE_SIZE
public static final int LONG_BYTE_SIZE
public static final int CHAR_NULLABLE_BYTE_SIZE
public static final int CHAR_BYTE_SIZE
public static final int FLOAT_BYTE_SIZE
public static final int DOUBLE_BYTE_SIZE
public static final int REFERENCE_NULLABLE_BYTE_SIZE
public static final int REFERENCE_BYTE_SIZE
public static final int NULL_BYTE_SIZE
public void initialize(ClassInfoFactory classInfoFactory, IObjectIOManagerForObjectIO objectIOManager) throws BinaryConverterException
BinaryConverterException
public String getTypeName(int typeCode)
public int byteSize(byte typeRecord)
public int getType(byte typeRecord)
typeRecord
- public byte[] toBinary(boolean valueDefined, Object object, ClassInfo classInfo) throws BinaryConverterException
valueDefined
- object
- classInfo
- BinaryConverterException
IllegalArgumentException
- no converter for the classpublic int toBinary(byte[] binary, int offset, ClassInfo classInfo, boolean valueDefined, Object object) throws BinaryConverterException
binary
- where put the resultoffset
- offset on binary array to write the resultclassInfo
- the class of the objectvalueDefined
- true if write a defined valueobject
- the object from which take the valueBinaryConverterException
IllegalArgumentException
- no converter for the class, bad obbject typepublic AbstractConverter fromBinary(byte[] binary, int offset, ClassInfo classInfo) throws BinaryConverterException
binary
- the binary valueoffset
- offset of the binary value in binary arrayclassInfo
- the class of the objectBinaryConverterException
public AbstractConverter fromBinary(byte[] binary, int offset) throws BinaryConverterException
binary
- the binary valueoffset
- offset of the binary value in binary arrayBinaryConverterException
public int getType(byte[] binary, int offset) throws BinaryConverterException
BinaryConverterException
Copyright © 2007-2012 Luc Peuvrier. All Rights Reserved.