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


C# BinaryWriter.WriteBig方法代码示例

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


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

示例1: WriteToStream

        public void WriteToStream(Stream stream)
        {
            if (Entries == null)
                return;

            Count = Entries.Length;

            BinaryWriter bw = new BinaryWriter(stream);
            bw.Write(MagicNumber);
            bw.WriteBig(Count);
            bw.Write(0L);

            if (Count < 1)
                return;

            for (int i = 0; i < Count; i++)
            {
                WpdEntry entry = Entries[i];

                byte[] bytes = Encoding.ASCII.GetBytes(entry.NameWithoutExtension);
                Array.Resize(ref bytes, 16);
                bw.Write(bytes, 0, bytes.Length);

                bw.WriteBig(entry.Offset);
                bw.WriteBig(entry.Length);

                bytes = Encoding.ASCII.GetBytes(entry.Extension);
                Array.Resize(ref bytes, 8);
                bw.Write(bytes, 0, bytes.Length);
            }
        }
开发者ID:kidaa,项目名称:Pulse,代码行数:31,代码来源:WpdHeader.cs

示例2: WriteToStream

 public void WriteToStream(Stream stream)
 {
     BinaryWriter bw = new BinaryWriter(stream);
     bw.WriteBig(Unknown1);
     bw.WriteBig(Unknown2);
     bw.WriteBig(Unknown3);
     bw.WriteBig(Unknown4);
 }
开发者ID:kidaa,项目名称:Pulse,代码行数:8,代码来源:TextureHeader.cs

示例3: WriteToStream

 public void WriteToStream(Stream stream)
 {
     BinaryWriter bw = new BinaryWriter(stream);
     bw.WriteBig(PackageNameOffset);
     bw.WriteBig(Length);
     bw.WriteBig(Dummy);
     bw.WriteBig(Offset);
 }
开发者ID:truongan012,项目名称:Pulse,代码行数:8,代码来源:WdbMovieEntry.cs

示例4: WriteToStream

 public void WriteToStream(Stream stream)
 {
     BinaryWriter bw = new BinaryWriter(stream);
     bw.Write(Magic);
     bw.Write((int)Type);
     bw.WriteBig(Version);
     bw.WriteBig(Unknown2);
     bw.WriteBig(SectionLength);
     stream.Write(Junk, 0, Junk.Length);
 }
开发者ID:truongan012,项目名称:Pulse,代码行数:10,代码来源:SectionHeader.cs

示例5: WriteToStream

 public void WriteToStream(Stream stream)
 {
     BinaryWriter bw = new BinaryWriter(stream);
     bw.WriteBig(Magic);
     bw.Write(Unknown1);
     bw.Write(Unknown2);
     bw.Write((byte)Format);
     bw.Write(MipMapCount);
     bw.Write(Unknown3);
     bw.Write((byte)(IsCubeMap ? 1 : 0));
     bw.WriteBig(Width);
     bw.WriteBig(Height);
     bw.WriteBig(Depth);
     bw.WriteBig(LinerSize);
     bw.WriteBig(DataOffset);
 }
开发者ID:akimoto-akira,项目名称:Pulse,代码行数:16,代码来源:GtexHeader.cs

示例6: Save

        public void Save(string fileName)
        {
            FileStream fs = File.Create(fileName);
            BinaryWriter bw = new BinaryWriter(fs);

            const int FONT_INFO_VERSION = 42;
            //const int FONT_INFO_MAGIC = (FONT_INFO_VERSION | ('i' << 24) | ('d' << 16) | ('f' << 8));

            ASCIIEncoding asen = new ASCIIEncoding();
            byte[] ascii = asen.GetBytes("idf1");
            ascii[3] = FONT_INFO_VERSION;
            bw.Write(ascii);

            bw.WriteBig(pointSize);
            bw.WriteBig(ascender);
            bw.WriteBig(descender);

            short numGlyphs = (short)glyphs.Count();
            bw.WriteBig(numGlyphs);

            foreach (var glyph in glyphs)
            {
                bw.Write(glyph.width);
                bw.Write(glyph.height);
                bw.Write(glyph.top);
                bw.Write(glyph.left);
                bw.Write(glyph.xSkip);
                byte padding = 0;
                bw.Write(padding);
                bw.Write(glyph.s);
                bw.Write(glyph.t);
            }

            foreach (var glyph in glyphs)
            {
                bw.Write(glyph.id);
            }

            bw.Close();
            fs.Close();
        }
开发者ID:Zbyl,项目名称:BFGFontTool,代码行数:41,代码来源:BFGFonts.cs

示例7: WriteToStream

        public void WriteToStream(Stream stream)
        {
            BinaryWriter bw = new BinaryWriter(stream);

            bw.Write(Type);
            bw.Write(Index);
            bw.Write(AssociatedIndex);
            bw.Write(Unknown);

            for (int i = 0; i < TransformationMatrix.Length; i++)
                bw.WriteBig(TransformationMatrix[i]);

            YkdOffsets.WriteToStream(stream, ref Offsets, ref Entries, b => b.CalcSize());
            stream.WriteContent(Entries);

            if (ZeroTail != null)
                stream.WriteContent(ZeroTail);
            else if (Tails4 != null)
                stream.WriteContent(Tails4);
            else if (Tail56 != null)
                for (int i = 0; i < Tail56.Length; i++)
                    bw.Write(Tail56[i]);
        }
开发者ID:kidaa,项目名称:Pulse,代码行数:23,代码来源:YkdBlockHeader.cs

示例8: WriteToStream

        public unsafe void WriteToStream(Stream output)
        {
            BinaryWriter bw = new BinaryWriter(output);
            bw.WriteBig(BlockSize);

            if (BlockSize > 0)
                throw new NotImplementedException();
        }
开发者ID:truongan012,项目名称:Pulse,代码行数:8,代码来源:ZtrFileEncoding.cs

示例9: WriteToStream

 public void WriteToStream(Stream stream)
 {
     BinaryWriter bw = new BinaryWriter(stream);
     bw.WriteBig(Offset);
     bw.WriteBig(Length);
 }
开发者ID:kidaa,项目名称:Pulse,代码行数:6,代码来源:GtexMipMapLocation.cs


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