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


C# Struct.Write方法代码示例

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


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

示例1: WriteStruct

        public void WriteStruct(int type, Struct s)
        {
            if (s == null)
            {
                s = Struct.Create(type);
            }

            int width = s.GetSizeWidth();
            int pos = -1;
            if (width > 0)
            {
                pos = BeginSize(width);
            }

            if (type > 0)
            {
                WriteUint16(type);
            }

            s.Write(this);

            if (width > 0)
            {
                EndSize(width, pos);
            }
        }
开发者ID:drzo,项目名称:opensim4opencog,代码行数:26,代码来源:AbstractEncoder.cs

示例2: WriteStruct32

 public void WriteStruct32(Struct s)
 {
     if (s == null)
     {
         WriteUint32(0);
     }
     else
     {
         int pos = BeginSize32();
         WriteUint16(s.GetEncodedType());
         s.Write(this);
         EndSize32(pos);
     }
 }
开发者ID:drzo,项目名称:opensim4opencog,代码行数:14,代码来源:AbstractEncoder.cs

示例3: Write

		public override void Write(IO.EndianWriter stream)
		{
			const int k_alignment = Compiler.kDefaultAlignment;
			int align;
			using (var mem = InitializeMemoryStream())
			{
				DynamicTagGroups.Write(MemoryStream); // write the data array to the stream
				MemoryStream.Write((int)0); MemoryStream.Write((int)0); // alignment

				StringPoolToMemoryStream();

				Import import = OwnerState.Importer as Import;

				FixupsToMemoryStream();

				#region Scripting
				{
				}
				#endregion

				EnumerationsToMemoryStream();

				TagReferencesToMemoryStream();

				TagDataToMemoryStream();

				#region TagBlock
				TagBlock tb = new TagBlock();
				foreach (Import.TagBlock tagb in import.Blocks.Values)
				{
					tb.Reset(tagb);
					tb.Write(MemoryStream);
				}
				#endregion

				#region Struct
				Struct strct = new Struct();
				foreach (Import.Struct tags in import.Structs.Values)
				{
					strct.Reset(tags);
					strct.Write(MemoryStream);
				}
				#endregion

				#region TagGroup
				TagGroup tg = new TagGroup();
				foreach (Import.TagGroup tagg in import.Groups.Values)
				{
					tg.Reset(tagg);
					tg.Write(MemoryStream);
				}
				#endregion

				PostprocessWritebacks();

				// Create header
				PostprocessHeaderThenStream(stream, CalculateStringPoolBaseAddress());

				mem.WriteTo(stream.BaseStream); // write all the data that will be read into memory from a tool to the file
			}

			align = k_alignment - (stream.Length % k_alignment);
			if (align != k_alignment) stream.Write(new byte[align]);
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:64,代码来源:Compiler.cs


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