本文整理汇总了C#中IO.ReadUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# IO.ReadUInt16方法的具体用法?C# IO.ReadUInt16怎么用?C# IO.ReadUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IO
的用法示例。
在下文中一共展示了IO.ReadUInt16方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public override void Read(IO.EndianReader s)
{
BlamVersion ver = (BlamVersion)s.ReadUInt16();
// HACK: this is a hack
if (ver == BlamVersion.Halo1)
ver = BlamVersion.Halo1_CE;
Debug.Assert.If(ver == engine, "Engine version mismatch: expected {0}, but got {1}", engine, ver);
s.Seek(2, System.IO.SeekOrigin.Current);
#region FileNames
int file_count = s.ReadInt32();
for (int x = 0; x < file_count; x++) files.Add(s.ReadCString());
#endregion
}
示例2: Read
/// <summary>
/// Extension method for <see cref="BlamVersion"/> for streaming an instance from a stream
/// </summary>
/// <param name="version"></param>
/// <param name="s"></param>
public static void Read(this BlamVersion version, IO.EndianReader s) { version = (BlamVersion)s.ReadUInt16(); }
示例3: Read
/// <summary>
/// Stream the field from a buffer
/// </summary>
/// <param name="er"></param>
public override void Read(IO.EndianReader er)
{
if (this.fieldType == FieldType.ByteFlags) Value = er.ReadByte();
else if (this.fieldType == FieldType.WordFlags) Value = er.ReadUInt16();
else if (this.fieldType == FieldType.LongFlags) Value = er.ReadUInt32();
}