本文整理汇总了C#中SerializationReader.ReadOptimizedByte方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationReader.ReadOptimizedByte方法的具体用法?C# SerializationReader.ReadOptimizedByte怎么用?C# SerializationReader.ReadOptimizedByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SerializationReader
的用法示例。
在下文中一共展示了SerializationReader.ReadOptimizedByte方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public void Deserialize(byte[] mySerializedBytes)
{
var _SerializationReader = new SerializationReader(mySerializedBytes);
ObjectLocation = _SerializationReader.ReadString();
NewDefaultRule = _SerializationReader.ReadOptimizedByte();
}
示例2: Deserialize
public void Deserialize(byte[] mySerializedBytes)
{
SerializationReader reader = new SerializationReader(mySerializedBytes);
ServiceGlobalUniqueName = reader.ReadString();
String _ServiceUri = reader.ReadString();
ServiceType = (DiscoverableServiceType)reader.ReadOptimizedByte();
if (!Uri.TryCreate(_ServiceUri,UriKind.Absolute,out ServiceUri))
throw new NotificationException_InvalidNotificationPayload("IP not parseable. Notification Packet invalid!");
}
示例3: 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();
}
示例4: MyDeserialize
private object MyDeserialize(SerializationReader reader, System.Type type)
{
var result = (SettingInvalidReferenceHandling)base.Deserialize(reader, type);
result.Behaviour = (BehaviourOnInvalidReference)reader.ReadOptimizedByte();
return result;
}
示例5: MyDeserialize
private object MyDeserialize(SerializationReader reader, System.Type type)
{
var result = (SettingUndefAttrBehaviour)base.Deserialize(reader, type);
result.Behaviour = (UndefAttributeBehaviour)reader.ReadOptimizedByte();
return result;
}
示例6: Deserialize
public override void Deserialize(ref SerializationReader mySerializationReader)
{
UInt16 NumberOfObjectLocatorPositions;
UInt16 NumberOfINodePositions;
try
{
#region Read Common attributes
_CreationTime = mySerializationReader.ReadUInt64();
_LastModificationTime = mySerializationReader.ReadUInt64();
_LastAccessTime = mySerializationReader.ReadUInt64();
_DeletionTime = mySerializationReader.ReadUInt64();
_ObjectSize = mySerializationReader.ReadUInt64();
#endregion
#region Object Safety and Security
_IntegrityCheckAlgorithm = (IntegrityCheckTypes)mySerializationReader.ReadOptimizedByte();
_EncryptionAlgorithm = (SymmetricEncryptionTypes)mySerializationReader.ReadOptimizedByte();
#endregion
#region Read list of ObjectLocatorPositions
_ObjectLocatorLength = mySerializationReader.ReadUInt64();
_ObjectLocatorCopies = mySerializationReader.ReadUInt64();
NumberOfObjectLocatorPositions = mySerializationReader.ReadUInt16();
_ObjectLocatorPositions = new List<ExtendedPosition>();
for (int i = 1; i <= NumberOfObjectLocatorPositions; i++)
_ObjectLocatorPositions.Add(new ExtendedPosition(new StorageUUID(mySerializationReader.ReadByteArray()), mySerializationReader.ReadUInt64()));
#endregion
#region Read list of INodePositions
NumberOfINodePositions = mySerializationReader.ReadUInt16();
_INodePositions = new List<ExtendedPosition>();
for (int i = 1; i <= NumberOfINodePositions; i++)
_INodePositions.Add(new ExtendedPosition(new StorageUUID(mySerializationReader.ReadByteArray()), mySerializationReader.ReadUInt64()));
#endregion
#region Read State
_ObjectLocatorStates = (ObjectLocatorStates)mySerializationReader.ReadOptimizedByte();
#endregion
}
catch (Exception e)
{
throw new GraphFSException_INodeCouldNotBeDeserialized("INode could not be deserialized!\n\n" + e);
}
//isDirty = true; // this is not useful!
}
示例7: Deserialize
public override void Deserialize(ref SerializationReader mySerializationReader)
{
#region Data
UInt64 _NumberOfACLs;
RightUUID _RightUUID;
EntityUUID _EntityUUID;
UInt64 _NumberOfEntityUUIDs;
HashSet<EntityUUID> _EntityUUIDHashSet;
#endregion
try
{
#region NotificationHandling
_NotificationHandling = (NHAccessControlObject)mySerializationReader.ReadOptimizedByte();
#endregion
#region DefaultRule
_DefaultRule = (DefaultRuleTypes)mySerializationReader.ReadOptimizedByte();
#endregion
#region AllowACL
_AllowACL = new Dictionary<RightUUID, HashSet<EntityUUID>>();
_NumberOfACLs = mySerializationReader.ReadUInt64();
for (UInt64 i=0; i<_NumberOfACLs; i++)
{
#region KEY
_RightUUID = new RightUUID(mySerializationReader.ReadByteArray());
#endregion
#region VALUE
_EntityUUIDHashSet = new HashSet<EntityUUID>();
_NumberOfEntityUUIDs = mySerializationReader.ReadUInt64();
for (UInt64 j=0; j<_NumberOfEntityUUIDs; j++)
{
_EntityUUID = new EntityUUID(mySerializationReader.ReadByteArray());
_EntityUUIDHashSet.Add(_EntityUUID);
}
// Finally... add it to the AllowACL!
_AllowACL.Add(_RightUUID, _EntityUUIDHashSet);
#endregion
}
#endregion
#region DenyACL
_DenyACL = new Dictionary<RightUUID, HashSet<EntityUUID>>();
_NumberOfACLs = mySerializationReader.ReadUInt64();
for (UInt64 i=0; i<_NumberOfACLs; i++)
{
#region KEY
_RightUUID = new RightUUID(mySerializationReader.ReadByteArray());
#endregion
#region VALUE
_EntityUUIDHashSet = new HashSet<EntityUUID>();
_NumberOfEntityUUIDs = mySerializationReader.ReadUInt64();
for (UInt64 j=0; j<_NumberOfEntityUUIDs; j++)
{
_EntityUUID = new EntityUUID(mySerializationReader.ReadByteArray());
_EntityUUIDHashSet.Add(_EntityUUID);
}
// Finally... add it to the DenyACL!
_DenyACL.Add(_RightUUID, _EntityUUIDHashSet);
#endregion
}
#endregion
}
//.........这里部分代码省略.........
示例8: 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);
}
}