本文整理汇总了C#中SerializationReader.ReadUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationReader.ReadUInt32方法的具体用法?C# SerializationReader.ReadUInt32怎么用?C# SerializationReader.ReadUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializationReader
的用法示例。
在下文中一共展示了SerializationReader.ReadUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public void Deserialize(byte[] mySerializedBytes)
{
var _SerializationReader = new SerializationReader(mySerializedBytes);
StorageURIs = new List<String>();
UInt32 numberOfStorageURIs = _SerializationReader.ReadUInt32();
for(UInt32 i=0; i<numberOfStorageURIs; i++)
StorageURIs.Add(_SerializationReader.ReadString());
StorageType = _SerializationReader.ReadString();
StorageSize = _SerializationReader.ReadUInt64();
}
示例2: Deserialize
public void Deserialize(ref SerializationReader mySerializationReader)
{
Features = new List<FeatureIDs>();
UInt32 cnt = mySerializationReader.ReadUInt32();
for (int i = 0; i < cnt; i++)
{
byte entry = mySerializationReader.ReadOptimizedByte();
Features.Add((FeatureIDs)entry);
}
NumberOfLicensedCPUs = mySerializationReader.ReadInt32();
NumberOfLicensedRAM = mySerializationReader.ReadInt32();
}
示例3: Deserialize
private object Deserialize(ref SerializationReader mySerializationReader, DirectoryEntry myDirectoryEntry)
{
try
{
#region Read the Inlinedata
myDirectoryEntry._InlineData = mySerializationReader.ReadByteArray();
#endregion
#region Read the INodePositions
var _NumOfINodePositions = mySerializationReader.ReadUInt32();
if (_NumOfINodePositions > 0)
{
for (var j = 0UL; j < _NumOfINodePositions; j++)
{
StorageUUID ID = new StorageUUID();
ID.Deserialize(ref mySerializationReader);
myDirectoryEntry._INodePositions.Add(new ExtendedPosition(ID, mySerializationReader.ReadUInt64()));
}
}
#endregion
#region Read the ObjectStreamsList
var _NumberOfObjectStreamTypes = mySerializationReader.ReadUInt32();
if (_NumberOfObjectStreamTypes > 0)
{
for (var j = 0UL; j < _NumberOfObjectStreamTypes; j++)
myDirectoryEntry._ObjectStreamsList.Add(mySerializationReader.ReadString());
}
#endregion
}
catch (GraphFSException e)
{
throw new GraphFSException("DirectoryEntry could not be deserialized!\n\n" + e);
}
myDirectoryEntry.isDirty = true;
return myDirectoryEntry;
}
示例4: Deserialize
private object Deserialize(ref SerializationReader mySerializationReader, EdgeTypeListOfBaseObjects myValue)
{
var count = mySerializationReader.ReadUInt32();
myValue._Objects = new List<ADBBaseObject>();
for (UInt32 i = 0; i < count; i++)
{
myValue._Objects.Add((ADBBaseObject)mySerializationReader.ReadObject());
}
return myValue;
}
示例5: Deserialize
private object Deserialize(ref SerializationReader mySerializationReader, DirectoryEntry myDirectoryEntry)
{
try
{
#region Read the Inlinedata
myDirectoryEntry._InlineData = mySerializationReader.ReadByteArray();
#region Estimated Size
if (myDirectoryEntry._InlineData != null)
{
myDirectoryEntry._estimatedSize += Convert.ToUInt64(myDirectoryEntry._InlineData.Length) * EstimatedSizeConstants.Byte;
}
#endregion
#endregion
#region Read the INodePositions
#region Estimated Size
myDirectoryEntry._estimatedSize += EstimatedSizeConstants.HashSet;
#endregion
var _NumOfINodePositions = mySerializationReader.ReadUInt32();
if (_NumOfINodePositions > 0)
{
for (var j = 0UL; j < _NumOfINodePositions; j++)
{
StorageUUID ID = new StorageUUID();
ID.Deserialize(ref mySerializationReader);
myDirectoryEntry._INodePositions.Add(new ExtendedPosition(ID, mySerializationReader.ReadUInt64()));
#region Estimated Size
myDirectoryEntry._estimatedSize += EstimatedSizeConstants.ExtendedPosition;
#endregion
}
}
#endregion
#region Read the ObjectStreamsList
#region Estimated Size
myDirectoryEntry._estimatedSize += EstimatedSizeConstants.HashSet;
#endregion
var _NumberOfObjectStreamTypes = mySerializationReader.ReadUInt32();
if (_NumberOfObjectStreamTypes > 0)
{
for (var j = 0UL; j < _NumberOfObjectStreamTypes; j++)
{
myDirectoryEntry._ObjectStreamsList.Add(mySerializationReader.ReadString());
#region Estimated Size
myDirectoryEntry._estimatedSize += EstimatedSizeConstants.Char * EstimatedSizeConstants.EstimatedObjectStreamNameLength;
#endregion
}
}
#endregion
}
catch (GraphFSException e)
{
throw new GraphFSException("DirectoryEntry could not be deserialized!\n\n" + e);
}
myDirectoryEntry.isDirty = true;
return myDirectoryEntry;
}
示例6: LoadVertex
/// <summary>
/// Loads the vertex.
/// </summary>
/// <param name='reader'> Reader. </param>
/// <param name='graphElements'> Graph elements. </param>
/// <param name='edgeTodo'> Edge todo. </param>
private static void LoadVertex(SerializationReader reader, BigList<AGraphElement> graphElements,
Dictionary<Int32, List<EdgeOnVertexToDo>> edgeTodo)
{
var id = reader.ReadInt32();
var creationDate = reader.ReadUInt32();
var modificationDate = reader.ReadUInt32();
#region properties
var propertyCount = reader.ReadInt32();
PropertyContainer[] properties = null;
if (propertyCount > 0)
{
properties = new PropertyContainer[propertyCount];
for (var i = 0; i < propertyCount; i++)
{
var propertyIdentifier = reader.ReadUInt16();
var propertyValue = reader.ReadObject();
properties[i] = new PropertyContainer {PropertyId = propertyIdentifier, Value = propertyValue};
}
}
#endregion
#region edges
#region outgoing edges
List<EdgeContainer> outEdgeProperties = null;
var outEdgeCount = reader.ReadInt32();
if (outEdgeCount > 0)
{
outEdgeProperties = new List<EdgeContainer>(outEdgeCount);
for (var i = 0; i < outEdgeCount; i++)
{
var outEdgePropertyId = reader.ReadUInt16();
var outEdgePropertyCount = reader.ReadInt32();
var outEdges = new List<EdgeModel>(outEdgePropertyCount);
for (var j = 0; j < outEdgePropertyCount; j++)
{
var edgeId = reader.ReadInt32();
EdgeModel edge = graphElements.GetElement(edgeId) as EdgeModel;
if (edge != null)
{
outEdges.Add(edge);
}
else
{
var aEdgeTodo = new EdgeOnVertexToDo
{
VertexId = id,
EdgePropertyId = outEdgePropertyId,
IsIncomingEdge = false
};
List<EdgeOnVertexToDo> todo;
if (edgeTodo.TryGetValue(edgeId, out todo))
{
todo.Add(aEdgeTodo);
}
else
{
edgeTodo.Add(edgeId, new List<EdgeOnVertexToDo> {aEdgeTodo});
}
}
}
outEdgeProperties.Add(new EdgeContainer(outEdgePropertyId, outEdges));
}
}
#endregion
#region incoming edges
List<EdgeContainer> incEdgeProperties = null;
var incEdgeCount = reader.ReadInt32();
if (incEdgeCount > 0)
{
incEdgeProperties = new List<EdgeContainer>(incEdgeCount);
for (var i = 0; i < incEdgeCount; i++)
{
var incEdgePropertyId = reader.ReadUInt16();
var incEdgePropertyCount = reader.ReadInt32();
var incEdges = new List<EdgeModel>(incEdgePropertyCount);
for (var j = 0; j < incEdgePropertyCount; j++)
{
var edgeId = reader.ReadInt32();
EdgeModel edge = graphElements.GetElement(edgeId) as EdgeModel;
//.........这里部分代码省略.........
示例7: LoadEdge
/// <summary>
/// Loads the edge.
/// </summary>
/// <param name='reader'> Reader. </param>
/// <param name='graphElements'> Graph elements. </param>
/// <param name='sneakPeaks'> Sneak peaks. </param>
private static void LoadEdge(SerializationReader reader, BigList<AGraphElement> graphElements,
ref List<EdgeSneakPeak> sneakPeaks)
{
var id = reader.ReadInt32();
var creationDate = reader.ReadUInt32();
var modificationDate = reader.ReadUInt32();
#region properties
PropertyContainer[] properties = null;
var propertyCount = reader.ReadInt32();
if (propertyCount > 0)
{
properties = new PropertyContainer[propertyCount];
for (var i = 0; i < propertyCount; i++)
{
var propertyIdentifier = reader.ReadUInt16();
var propertyValue = reader.ReadObject();
properties[i] = new PropertyContainer {PropertyId = propertyIdentifier, Value = propertyValue};
}
}
#endregion
var sourceVertexId = reader.ReadInt32();
var targetVertexId = reader.ReadInt32();
VertexModel sourceVertex = graphElements.GetElement(sourceVertexId) as VertexModel;
VertexModel targetVertex = graphElements.GetElement(targetVertexId) as VertexModel;
if (sourceVertex != null && targetVertex != null)
{
graphElements.SetValue(id,new EdgeModel(id, creationDate, modificationDate, targetVertex,sourceVertex, properties));
}
else
{
sneakPeaks.Add(new EdgeSneakPeak
{
CreationDate = creationDate,
Id = id,
ModificationDate = modificationDate,
Properties = properties,
SourceVertexId = sourceVertexId,
TargetVertexId = targetVertexId
});
}
}
示例8: Deserialize
private object Deserialize(ref SerializationReader mySerializationReader, IndexKey myValue)
{
UInt32 count = mySerializationReader.ReadUInt32();
for (UInt32 i = 0; i < count; i++)
{
var a = (ADBBaseObject)mySerializationReader.ReadObject();
myValue._indexKeyValues.Add(a);
CalcNewHashCode(a, ref myValue._hashCode);
}
return myValue;
}
示例9: Deserialize
public override void Deserialize(ref SerializationReader mySerializationReader)
{
UInt32 _Capacity;
if (mySerializationReader != null)
{
try
{
_UUID = new TypeUUID(this.ObjectUUID.GetByteArray());
ParentTypeUUID = new TypeUUID();
ParentTypeUUID.Deserialize(ref mySerializationReader);
_IsUserDefined = mySerializationReader.ReadBoolean();
_IsAbstract = mySerializationReader.ReadBoolean();
_Comment = mySerializationReader.ReadString();
_Capacity = mySerializationReader.ReadUInt32();
_Attributes = new Dictionary<AttributeUUID, TypeAttribute>();
_TypeAttributeLookupTable = new Dictionary<AttributeUUID, TypeAttribute>();
for (UInt32 i = 0; i < _Capacity; i++)
{
var _AttrAtrib = new AttributeUUID();
_AttrAtrib.Deserialize(ref mySerializationReader);
var _TypeObj = new TypeAttribute();
_TypeObj.Deserialize(ref mySerializationReader);
_Attributes.Add(_AttrAtrib, _TypeObj);
_TypeAttributeLookupTable.Add(_AttrAtrib, _TypeObj);
}
_Capacity = mySerializationReader.ReadUInt32();
_TypeSettings = new Dictionary<String, ADBSettingsBase>();
for (var i = 0; i < _Capacity; i++)
{
ADBSettingsBase _ADBSettingsBase = (ADBSettingsBase) mySerializationReader.ReadObject();
if(_ADBSettingsBase != null)
_TypeSettings.Add(_ADBSettingsBase.Name, _ADBSettingsBase);
}
_Capacity = mySerializationReader.ReadUInt32();
_UniqueAttributes = new List<AttributeUUID>();
AttributeUUID AttribID = null;
for (UInt32 i = 0; i < _Capacity; i++)
{
AttribID = new AttributeUUID(ref mySerializationReader);
_UniqueAttributes.Add(AttribID);
}
_Capacity = mySerializationReader.ReadUInt32();
_MandatoryAttributes = new HashSet<AttributeUUID>();
for (UInt32 i = 0; i < _Capacity; i++)
{
AttribID = new AttributeUUID(ref mySerializationReader);
_MandatoryAttributes.Add(AttribID);
}
ObjectDirectoryShards = mySerializationReader.ReadUInt16();
#region Indices
_AttributeIndices = new Dictionary<IndexKeyDefinition, Dictionary<String, AAttributeIndex>>();
_AttributeIndicesNameLookup = new Dictionary<String, IndexKeyDefinition>();
var idxCount = mySerializationReader.ReadUInt32();
for (var i = 0; i < idxCount; i++)
{
var idxKey = new IndexKeyDefinition();
idxKey.Deserialize(ref mySerializationReader);
//_AttributeIndices.Add(idxKey, new Dictionary<String, AttributeIndex>());
var idxVersionCount = mySerializationReader.ReadUInt32();
for (var j = 0; j < idxVersionCount; j++)
{
var key = mySerializationReader.ReadString();
var fileSystemLocation = new ObjectLocation(mySerializationReader.ReadString());
var indexEdition = mySerializationReader.ReadString();
var indexName = mySerializationReader.ReadString();
var indexType = mySerializationReader.ReadString();
var isUUIDIdx = mySerializationReader.ReadBoolean();
var keyCount = mySerializationReader.ReadUInt64();
var valueCount = mySerializationReader.ReadUInt64();
var attributeIdxShards = mySerializationReader.ReadUInt16();
//var CreateIdxExcept = CreateAttributeIndex(indexName, idxKey.IndexKeyAttributeUUIDs, indexEdition, indexObjectType, fileSystemLocation);
if (isUUIDIdx)
{
AddAttributeIndex(new UUIDIndex(indexName, idxKey, this, attributeIdxShards, indexType, indexEdition, keyCount));
}
else
{
AddAttributeIndex(new AttributeIndex(indexName, idxKey, this, attributeIdxShards, indexType, indexEdition, keyCount, valueCount));
//.........这里部分代码省略.........
示例10: Deserialize
private object Deserialize(ref SerializationReader mySerializationReader, EdgeTypeSetOfBaseObjects myValue)
{
var count = mySerializationReader.ReadUInt32();
myValue._Objects = new HashSet<ADBBaseObject>();
for (UInt32 i = 0; i < count; i++)
{
myValue._Objects.Add((ADBBaseObject)mySerializationReader.ReadObject());
}
CalcEstimatedSize(myValue);
return myValue;
}
示例11: Deserialize
public override void Deserialize(ref SerializationReader mySerializationReader)
{
UInt32 _Capacity;
if (mySerializationReader != null)
{
try
{
_UUID = new TypeUUID(this.ObjectUUID.GetByteArray());
ParentTypeUUID = new TypeUUID();
ParentTypeUUID.Deserialize(ref mySerializationReader);
_IsUserDefined = mySerializationReader.ReadBoolean();
_IsAbstract = mySerializationReader.ReadBoolean();
_Comment = mySerializationReader.ReadString();
_Capacity = mySerializationReader.ReadUInt32();
_Attributes = new Dictionary<AttributeUUID, TypeAttribute>();
_TypeAttributeLookupTable = new Dictionary<AttributeUUID, TypeAttribute>();
for (UInt32 i = 0; i < _Capacity; i++)
{
var _AttrAtrib = new AttributeUUID();
_AttrAtrib.Deserialize(ref mySerializationReader);
var _TypeObj = new TypeAttribute();
_TypeObj.Deserialize(ref mySerializationReader);
_Attributes.Add(_AttrAtrib, _TypeObj);
_TypeAttributeLookupTable.Add(_AttrAtrib, _TypeObj);
}
_Capacity = mySerializationReader.ReadUInt32();
_TypeSettings = new Dictionary<String, ADBSettingsBase>();
for (var i = 0; i < _Capacity; i++)
{
ADBSettingsBase _ADBSettingsBase = (ADBSettingsBase) mySerializationReader.ReadObject();
if(_ADBSettingsBase != null)
_TypeSettings.Add(_ADBSettingsBase.Name, _ADBSettingsBase);
}
_Capacity = mySerializationReader.ReadUInt32();
_UniqueAttributes = new List<AttributeUUID>();
AttributeUUID AttribID = null;
for (UInt32 i = 0; i < _Capacity; i++)
{
AttribID = new AttributeUUID(ref mySerializationReader);
_UniqueAttributes.Add(AttribID);
}
_Capacity = mySerializationReader.ReadUInt32();
_MandatoryAttributes = new HashSet<AttributeUUID>();
for (UInt32 i = 0; i < _Capacity; i++)
{
AttribID = new AttributeUUID(ref mySerializationReader);
_MandatoryAttributes.Add(AttribID);
}
#region Indices
_AttributeIndices = new Dictionary<IndexKeyDefinition, Dictionary<String, AAttributeIndex>>();
_AttributeIndicesNameLookup = new Dictionary<String, IndexKeyDefinition>();
_AttributeIndexLocations = new Dictionary<IndexKeyDefinition, Dictionary<string, Tuple<string, ObjectLocation>>>();
var idxCount = mySerializationReader.ReadUInt32();
for (var i = 0; i < idxCount; i++)
{
var idxKey = new IndexKeyDefinition();
idxKey.Deserialize(ref mySerializationReader);
//_AttributeIndices.Add(idxKey, new Dictionary<String, AttributeIndex>());
var idxVersionCount = mySerializationReader.ReadUInt32();
_AttributeIndexLocations.Add(idxKey, new Dictionary<string, Tuple<string, ObjectLocation>>());
for (var j = 0; j < idxVersionCount; j++)
{
var key = mySerializationReader.ReadString();
var idxLocation = mySerializationReader.ReadString();
var indexType = mySerializationReader.ReadString();
_AttributeIndexLocations[idxKey][key] = new Tuple<string,ObjectLocation>(indexType, new ObjectLocation(idxLocation));
//idx.IndexKeyDefinition = idxKey;
//AddAttributeIndex(idx as AAttributeIndex);
}
}
#endregion
}
catch (Exception e)
{
//.........这里部分代码省略.........
示例12: Deserialize
private object Deserialize(ref SerializationReader mySerializationReader, IndexKey myValue)
{
#region IEstimable
myValue._estimatedSize = GetBaseSize();
#endregion
UInt32 count = mySerializationReader.ReadUInt32();
for (UInt32 i = 0; i < count; i++)
{
var a = (ADBBaseObject)mySerializationReader.ReadObject();
myValue._indexKeyValues.Add(a);
_estimatedSize += a.GetEstimatedSize();
CalcNewHashCode(a, ref myValue._hashCode);
}
return myValue;
}
示例13: Deserialize
public void Deserialize(ref SerializationReader mySerializationReader)
{
UInt32 count = mySerializationReader.ReadUInt32();
_indexKeyAttributeUUIDs = new List<AttributeUUID>();
for (UInt32 i = 0; i < count; i++)
{
AttributeUUID AttributeUUID = new AttributeUUID();
AttributeUUID.Deserialize(ref mySerializationReader);
_indexKeyAttributeUUIDs.Add(AttributeUUID);
CalcNewHashCode(AttributeUUID);
}
}
示例14: Deserialize
public void Deserialize(byte[] mySerializedBytes)
{
var _SerializationReader = new SerializationReader(mySerializedBytes);
NumberOfQueueEntries = _SerializationReader.ReadUInt32();
}
示例15: Deserialize
public void Deserialize(ref SerializationReader mySerializationReader)
{
UInt32 _Capacity;
try
{
if (mySerializationReader != null)
{
UUID = new AttributeUUID();
UUID.Deserialize(ref mySerializationReader);
DBTypeUUID = new TypeUUID();
DBTypeUUID.Deserialize(ref mySerializationReader);
KindOfType = (KindsOfType)mySerializationReader.ReadOptimizedByte();
TypeCharacteristics = new TypeCharacteristics();
TypeCharacteristics.Deserialize(ref mySerializationReader);
Name = mySerializationReader.ReadString();
var hasEdgeType = mySerializationReader.ReadBoolean();
if (hasEdgeType)
{
try
{
EdgeType = (IEdgeType) mySerializationReader.ReadObject();
}
catch(Exception ex)
{
//NLOG: temporarily commented
//Logger.Fatal("Could not deserialize EdgeType");
throw new GraphDBException(new Error_UnknownDBError(ex));
}
}
RelatedGraphDBTypeUUID = new TypeUUID();
RelatedGraphDBTypeUUID.Deserialize(ref mySerializationReader);
if (TypeCharacteristics.IsBackwardEdge)
BackwardEdgeDefinition = (EdgeKey) mySerializationReader.ReadObject();
DefaultValue = (IObject) mySerializationReader.ReadObject();
#region Read Settings
_Capacity = mySerializationReader.ReadUInt32();
_Settings = new Dictionary<String, ADBSettingsBase>();
for (var i = 0; i < _Capacity; i++)
{
var _SettingObject = (ADBSettingsBase) mySerializationReader.ReadObject();
if (_SettingObject != null)
_Settings.Add(_SettingObject.Name, _SettingObject);
/*Type settingType = (Type)mySerializationReader.ReadObject();
ADBSettingsBase _SettingObject = null;
try
{
_SettingObject = (ADBSettingsBase)Activator.CreateInstance(settingType);
}
catch
{
Logger.Error("Could not create an instance of setting " + settingType.ToString());
}
Byte[] Bytes = (Byte[])mySerializationReader.ReadObject();
if (_SettingObject != null)
{
_SettingObject.Deserialize(new SerializationReader(Bytes));
_Settings.Add(_SettingObject.Name, _SettingObject);
}*/
}
#endregion
}
}
catch (Exception e)
{
throw new SerializationException("The Setting could not be deserialized!\n\n" + e);
}
}