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


C# IWriter.WriteUInt16方法代码示例

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


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

示例1: WriteLocaleChanges

        private static void WriteLocaleChanges(Patch patch, IWriter writer)
        {
            if (patch.LanguageChanges.Count == 0)
                return;

            long startPos = writer.Position;
            writer.WriteInt32(AssemblyPatchBlockID.Locl);
            writer.WriteUInt32(0); // Size filled in later
            writer.WriteByte(0); // Version 0

            // Write change data for each language
            writer.WriteByte((byte)patch.LanguageChanges.Count);
            foreach (LanguageChange language in patch.LanguageChanges)
            {
                writer.WriteByte(language.LanguageIndex);

                // Write the change data for each string in the language
                writer.WriteInt32(language.LocaleChanges.Count);
                foreach (LocaleChange change in language.LocaleChanges)
                {
                    writer.WriteUInt16((ushort)change.Index);
                    writer.WriteUTF8(change.NewValue);
                }
            }

            // Fill in the block size
            long endPos = writer.Position;
            writer.SeekTo(startPos + 4);
            writer.WriteUInt32((uint)(endPos - startPos));
            writer.SeekTo(endPos);
        }
开发者ID:YxCREATURExY,项目名称:Assembly,代码行数:31,代码来源:AssemblyPatchWriter.cs

示例2: WriteResourcePages

        private static void WriteResourcePages(TagContainer tags, ContainerWriter container, IWriter writer)
        {
            foreach (ResourcePage page in tags.ResourcePages)
            {
                container.StartBlock("rspg", 1);

                writer.WriteInt32(page.Index);
                writer.WriteUInt16(page.Salt);
                writer.WriteByte(page.Flags);
                writer.WriteAscii(page.FilePath ?? "");
                writer.WriteInt32(page.Offset);
                writer.WriteInt32(page.UncompressedSize);
                writer.WriteByte((byte) page.CompressionMethod);
                writer.WriteInt32(page.CompressedSize);
                writer.WriteUInt32(page.Checksum);
                WriteByteArray(page.Hash1, writer);
                WriteByteArray(page.Hash2, writer);
                WriteByteArray(page.Hash3, writer);
                writer.WriteInt32(page.Unknown1);
                writer.WriteInt32(page.Unknown2);
                writer.WriteInt32(page.Unknown3);

                container.EndBlock();
            }
        }
开发者ID:Cloms,项目名称:Assembly,代码行数:25,代码来源:TagContainerWriter.cs

示例3: WriteIndexBuffer

		/// <summary>
		///     Writes an index buffer to a stream.
		/// </summary>
		/// <param name="writer">The stream to write to.</param>
		/// <param name="indices">The indices to write.</param>
		public static void WriteIndexBuffer(IWriter writer, ushort[] indices)
		{
			for (int i = 0; i < indices.Length; i++)
				writer.WriteUInt16(indices[i]);
		}
开发者ID:t3hm00kz,项目名称:Assembly,代码行数:10,代码来源:IndexBufferWriter.cs


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