public void read(final byte[] binary,
final DataRecordIdentifier dataRecordIdentifier)
throws ObjectIOException, ObjectIOClassNotFoundException {
int offset = 0;
AbstractConverter binaryConverter;
/*
* first data is class name identifier and flag
*/
try {
binaryConverter = helperBinaryConversion.integerConverter;
binaryConverter.fromBinary(binary, offset);
} catch (BinaryConverterException exception) {
throw new ObjectIOException(FOR_DATA_RECORD + dataRecordIdentifier,
exception);
}
if (!binaryConverter.valueDefinedFromBinary) {
throw new ObjectIOException(
"class name identifier value must be defined for data record "
+ dataRecordIdentifier);
}
offset += HelperBinaryConversion.INT_BYTE_SIZE;
final int classNameIdentifierAndFormatFlag = ((Integer) binaryConverter.objectFromBinary)
.intValue();
binaryConverter.objectFromBinary = null;// NOPMD
extendedDatarecordFormat = (classNameIdentifierAndFormatFlag & 0x80000000) == 0x80000000;
if (extendedDatarecordFormat) {
/*
* record format identifier
*/
try {
binaryConverter = helperBinaryConversion.shortConverter;
binaryConverter.fromBinary(binary, offset);
} catch (BinaryConverterException exception) {
throw new ObjectIOException(FOR_DATA_RECORD
+ dataRecordIdentifier, exception);
}
offset += HelperBinaryConversion.SHORT_BYTE_SIZE;
if (!binaryConverter.valueDefinedFromBinary) {
throw new ObjectIOException(
"record format identifier value must be defined for data record "
+ dataRecordIdentifier);
}
recordFormatId = ((Short) binaryConverter.objectFromBinary)
.shortValue();
binaryConverter.objectFromBinary = null;// NOPMD
/*
* joafip release id
*/
try {
binaryConverter = helperBinaryConversion.integerConverter;
binaryConverter.fromBinary(binary, offset);
} catch (BinaryConverterException exception) {
throw new ObjectIOException(FOR_DATA_RECORD
+ dataRecordIdentifier, exception);
}
if (!binaryConverter.valueDefinedFromBinary) {
throw new ObjectIOException(
"joafip release id value must be defined for data record "
+ dataRecordIdentifier);
}
offset += HelperBinaryConversion.INT_BYTE_SIZE;
joafipReleaseId = ((Integer) binaryConverter.objectFromBinary)
.intValue();
binaryConverter.objectFromBinary = null;// NOPMD
/*
* data model identifier
*/
try {
binaryConverter = helperBinaryConversion.integerConverter;
binaryConverter.fromBinary(binary, offset);
} catch (BinaryConverterException exception) {
throw new ObjectIOException(FOR_DATA_RECORD
+ dataRecordIdentifier, exception);
}
if (!binaryConverter.valueDefinedFromBinary) {
throw new ObjectIOException(
"data model identifier value must be defined for data record "
+ dataRecordIdentifier);
}
offset += HelperBinaryConversion.INT_BYTE_SIZE;
dataModelIdentifier = ((Integer) binaryConverter.objectFromBinary)
.intValue();
binaryConverter.objectFromBinary = null;// NOPMD
/*
* flags
*/
if (recordFormatId == RecordFormatIdentifier.ID_FOR_3_0_1_THRU_3_1_0) {
try {
binaryConverter = helperBinaryConversion.byteConverter;
binaryConverter.fromBinary(binary, offset);
} catch (BinaryConverterException exception) {
throw new ObjectIOException(FOR_DATA_RECORD
+ dataRecordIdentifier, exception);
}
if (!binaryConverter.valueDefinedFromBinary) {