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


C# BinaryWriter.WriteBigEndian方法代码示例

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


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

示例1: Write

 public override void Write(BinaryWriter file, int positionOffset)
 {
     file.Write(Encoding.ASCII.GetBytes("REGN"));
     file.WriteBigEndian(this.Size);
     file.WriteBigEndian(this.Position + positionOffset);
     file.WriteBigEndian(this.Length);
 }
开发者ID:JeremyAnsel,项目名称:JeremyAnsel.Xwa.Imc,代码行数:7,代码来源:ImcRegnBlock.cs

示例2: Write

 public override void Write(BinaryWriter file, int positionOffset)
 {
     file.Write(Encoding.ASCII.GetBytes("TEXT"));
     file.WriteBigEndian(this.Size);
     file.WriteBigEndian(this.Position + positionOffset);
     file.Write(Encoding.ASCII.GetBytes(this.Text));
     file.Write((byte)0);
 }
开发者ID:JeremyAnsel,项目名称:JeremyAnsel.Xwa.Imc,代码行数:8,代码来源:ImcTextBlock.cs

示例3: Write

 public override void Write(BinaryWriter file, int positionOffset)
 {
     file.Write(Encoding.ASCII.GetBytes("JUMP"));
     file.WriteBigEndian(this.Size);
     file.WriteBigEndian(this.Position + positionOffset);
     file.WriteBigEndian(this.Destination + positionOffset);
     file.WriteBigEndian(this.HookId);
     file.WriteBigEndian(this.Delay);
 }
开发者ID:JeremyAnsel,项目名称:JeremyAnsel.Xwa.Imc,代码行数:9,代码来源:ImcJumpBlock.cs

示例4: WriteMap

        private static void WriteMap(ImcFile imc, BinaryWriter file, List<ImcBlock> blocks, int mapSize)
        {
            file.Write(Encoding.ASCII.GetBytes("MAP "));
            file.WriteBigEndian(mapSize);

            file.Write(Encoding.ASCII.GetBytes("FRMT"));
            file.WriteBigEndian(20);
            file.WriteBigEndian(mapSize + 24);
            file.WriteBigEndian(1);
            file.WriteBigEndian(imc.BitsPerSample);
            file.WriteBigEndian(imc.SampleRate);
            file.WriteBigEndian(imc.Channels);

            foreach (var block in blocks)
            {
                block.Write(file, mapSize + 24);
            }

            file.Write(Encoding.ASCII.GetBytes("STOP"));
            file.WriteBigEndian(4);
            file.WriteBigEndian(imc.DataRawSize + mapSize + 24);
        }
开发者ID:JeremyAnsel,项目名称:JeremyAnsel.Xwa.Imc,代码行数:22,代码来源:ImcFile.cs

示例5: Save

        public void Save(string fileName)
        {
            FileStream filestream = null;

            try
            {
                filestream = new FileStream(fileName, FileMode.Create, FileAccess.Write);

                using (BinaryWriter file = new BinaryWriter(filestream))
                {
                    filestream = null;

                    int mapSize;
                    var blocks = this.BuildMapBlocks(out mapSize);

                    file.Write(Encoding.ASCII.GetBytes("MCMP"));

                    file.WriteBigEndian((short)(this.Entries.Count + 1));

                    file.Write((byte)0);
                    file.WriteBigEndian(mapSize + 24);
                    file.WriteBigEndian(mapSize + 24);

                    foreach (var entry in this.Entries)
                    {
                        file.Write(entry.Codec);
                        file.WriteBigEndian(entry.RawSize);
                        file.WriteBigEndian(entry.CompressedSize);
                    }

                    file.WriteBigEndian((short)(this.Codecs.Count * 5));

                    foreach (var codec in this.Codecs)
                    {
                        file.Write(Encoding.ASCII.GetBytes(codec));
                        file.Write((byte)0);
                    }

                    file.Write(Encoding.ASCII.GetBytes("iMUS"));
                    file.Write(this.DataRawSize + mapSize + 16);

                    ImcFile.WriteMap(this, file, blocks, mapSize);

                    file.Write(Encoding.ASCII.GetBytes("DATA"));
                    file.WriteBigEndian(this.DataRawSize);

                    foreach (var entry in this.Entries)
                    {
                        file.Write(entry.Data);
                    }

                    this.FileName = fileName;
                }
            }
            finally
            {
                if (filestream != null)
                {
                    filestream.Dispose();
                }
            }
        }
开发者ID:JeremyAnsel,项目名称:JeremyAnsel.Xwa.Imc,代码行数:62,代码来源:ImcFile.cs


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