当前位置: 首页>>代码示例>>C#>>正文


C# IO.GetInputStream方法代码示例

本文整理汇总了C#中IO.GetInputStream方法的典型用法代码示例。如果您正苦于以下问题:C# IO.GetInputStream方法的具体用法?C# IO.GetInputStream怎么用?C# IO.GetInputStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IO的用法示例。


在下文中一共展示了IO.GetInputStream方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Read

		/// <summary>
		/// Seek the stream ahead however many bytes the size of this pad is
		/// </summary>
		/// <param name="ts"></param>
		public override void Read(IO.ITagStream ts)
		{
			if (ts.Flags.Test(IO.ITagStreamFlags.Halo2OldFormat_UselessPadding))
				ts.GetInputStream().Seek(Value, System.IO.SeekOrigin.Current);
		}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:9,代码来源:Padding.cs

示例2: Read

		/// <summary>
		/// Stream the field from a tag stream
		/// </summary>
		/// <param name="ts"></param>
		/// <exception cref="Exceptions.InvalidStringId"></exception>
		public override void Read(IO.ITagStream ts)
		{
			if (Handle.Set == -1) // HACK used to tell Read that we already read the string data (as this is an old halo 2 tag)
			{
				Handle = new Blam.StringId(Handle.Description, Handle.Index, Handle.Length, 0);
				return;
			}

			if (!ts.Flags.Test(IO.ITagStreamFlags.DontStreamStringData)) // stream the string id value if we can
			{
				IO.EndianReader s = ts.GetInputStream();
				relativeOffset = s.PositionUnsigned;
				string value = null;
				try
				{
					value = new string(s.ReadChars(Handle.Length));
					if (Handle != Blam.StringId.Null)
						Program.GetTagIndex(OwnerId).StringIds.TryAndGetStringId(value, out Handle);
				}
				catch (Exception ex)
				{
					throw new Exceptions.InvalidStringId(ex,
						base.headerOffset, base.relativeOffset, ts,
						Handle.Length, value);
				}
			}
		}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:32,代码来源:String.cs

示例3: Read

		/// <summary>
		/// Read the main body of this field from a tag stream
		/// </summary>
		/// <param name="ts"></param>
		public virtual void Read(IO.ITagStream ts)			{ this.Read(ts.GetInputStream()); }
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:5,代码来源:Field.cs

示例4: ReadHeader

		/// <summary>
		/// Stream the field header data from a tag stream
		/// </summary>
		/// <param name="ts"></param>
		/// <exception cref="Exceptions.InvalidStringId"></exception>
		public override void ReadHeader(IO.ITagStream ts)
		{
			IO.EndianReader s = ts.GetInputStream();
			headerOffset = s.PositionUnsigned; // nifty for debugging
			OwnerId = ts.OwnerId;

			string value = null;

			try
			{
				if (fieldType == FieldType.OldStringId && ts.Flags.Test(IO.ITagStreamFlags.Halo2OldFormat_StringId))
					value = s.ReadAsciiString(28); // max of 28 characters in the string id in old builds

				var owner = Program.GetTagIndex(OwnerId);
				Handle.Read(s, owner.StringIds.Definition.Description);

				if (value != null /*&& Handle != Blam.StringID.Null*/)
				{
					owner.StringIds.TryAndGetStringId(value, out Handle);
					Handle = new Blam.StringId(Handle.Description, Handle.Index, Handle.Length, 
						-1); // HACK used to tell Read that we already read the string data (as this is an old halo 2 tag)
				}
			}
			catch (Exception ex)
			{
				throw new Exceptions.InvalidStringId(ex,
					base.headerOffset, uint.MaxValue,
					ts, Handle.Length, value);
			}
		}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:35,代码来源:String.cs

示例5: Read

			public void Read(IO.ITagStream ts)
			{
				IO.EndianReader s = ts.GetInputStream();

				ReadHeader(s, ts);
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:6,代码来源:Version.cs


注:本文中的IO.GetInputStream方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。