ITypeDescriptor NestedDescriptorReader(AbstractBufferedReader reader)
{
var typeId = reader.ReadVInt32();
if (typeId < 0 && -typeId - 1 < _id2InfoNew.Count)
{
var infoForType = _id2InfoNew[-typeId - 1];
if (infoForType != null)
return infoForType.Descriptor;
}
else if (typeId > 0)
{
if (typeId >= _id2Info.Count)
throw new BTDBException("Metadata corrupted");
var infoForType = _id2Info[typeId];
if (infoForType == null)
throw new BTDBException("Metadata corrupted");
return infoForType.Descriptor;
}
return new PlaceHolderDescriptor(typeId);
}