AbstractConverter binaryConverter;
try {
binaryConverter = helperBinaryConversion.integerConverter;
binaryConverter.fromBinary(binary, currentOffset);
} catch (BinaryConverterException exception) {
throw new HeapRecordableException(exception);
}
if (!binaryConverter.valueDefinedFromBinary) {
throw new HeapRecordableException(
"number of referencing value must be defined");
}
final int numberOfReferencing = (Integer) binaryConverter.objectFromBinary;
binaryConverter.objectFromBinary = null;// NOPMD
currentOffset += HelperBinaryConversion.INT_BYTE_SIZE;
binaryConverter = helperBinaryConversion.referenceConverter;
binaryConverter.fromBinary(binary, currentOffset);
final DataRecordIdentifier referenced = (DataRecordIdentifier) binaryConverter.objectFromBinary;
binaryConverter.objectFromBinary = null;// NOPMD
currentOffset += HelperBinaryConversion.REFERENCE_BYTE_SIZE;
final ReferenceLink referenceLink = new ReferenceLink(referenced);
for (int count = 0; count < numberOfReferencing; count++) {
binaryConverter = helperBinaryConversion.referenceConverter;
binaryConverter.fromBinary(binary, currentOffset);
if (!binaryConverter.valueDefinedFromBinary) {
throw new HeapRecordableException(
"referencing data record identifier value must be defined");
}
final DataRecordIdentifier referencing = (DataRecordIdentifier)
/**/binaryConverter.objectFromBinary;
binaryConverter.objectFromBinary = null;// NOPMD
currentOffset += HelperBinaryConversion.REFERENCE_BYTE_SIZE;
try {
binaryConverter = helperBinaryConversion.integerConverter;
binaryConverter.fromBinary(binary, currentOffset);
} catch (BinaryConverterException exception) {
throw new HeapRecordableException(exception);
}
if (!binaryConverter.valueDefinedFromBinary) {
throw new HeapRecordableException(
"link count value must be defined");
}
final Integer linkCount = (Integer) binaryConverter.objectFromBinary;
binaryConverter.objectFromBinary = null;// NOPMD
currentOffset += HelperBinaryConversion.INT_BYTE_SIZE;
try {
referenceLink.setLinkCount(linkCount, referencing);
} catch (ReferenceLinkGarbageException exception) {
throw new HeapRecordableException(exception);
}
}
binaryConverter.objectFromBinary = null;// NOPMD
referenceLink.setNode(this);
return referenceLink;
} catch (BinaryConverterException exception) {
throw new HeapRecordableException(exception);
}
}