當前位置: 首頁>>代碼示例>>C#>>正文


C# BinaryWriter.WriteSizedBuffer方法代碼示例

本文整理匯總了C#中System.IO.BinaryWriter.WriteSizedBuffer方法的典型用法代碼示例。如果您正苦於以下問題:C# BinaryWriter.WriteSizedBuffer方法的具體用法?C# BinaryWriter.WriteSizedBuffer怎麽用?C# BinaryWriter.WriteSizedBuffer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.IO.BinaryWriter的用法示例。


在下文中一共展示了BinaryWriter.WriteSizedBuffer方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Write

        public void Write(MvdDocument document, BinaryWriter bw)
        {
            bw.WriteSizedBuffer(document.Encoding.GetBytes(this.ObjectName));
            bw.WriteSizedBuffer(document.Encoding.GetBytes(this.EnglishObjectName));
            bw.Write(this.KeyFps);
            bw.WriteSizedBuffer(new byte[0]);

            foreach (var i in this.Sections)
                i.Write(document, bw);

            bw.Write((byte)MvdTag.Eof);
            bw.Write((byte)0);
        }
開發者ID:mfakane,項目名稱:Keystone,代碼行數:13,代碼來源:MvdObject.cs

示例2: Write

        public void Write(BinaryWriter bw, PmxDocument doc)
        {
            bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.Name));
            bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.EnglishName));
            this.Diffuse.ForEach(bw.Write);
            this.Specular.ForEach(bw.Write);
            bw.Write(this.Power);
            this.Ambient.ForEach(bw.Write);
            bw.Write((byte)this.Options);
            this.EdgeColor.ForEach(bw.Write);
            bw.Write(this.EdgeSize);
            doc.WriteIndex(bw, PmxIndexKind.Texture, this.MainTexture);
            doc.WriteIndex(bw, PmxIndexKind.Texture, this.SubTexture);
            bw.Write((byte)this.SubTextureMode);
            bw.Write(this.UseSharedToonTexture);

            if (this.UseSharedToonTexture)
                bw.Write((byte)this.ToonTexture);
            else
                doc.WriteIndex(bw, PmxIndexKind.Texture, this.ToonTexture);

            bw.WriteSizedBuffer(doc.Header.Encoding.GetBytes(this.Comment));
            bw.Write(this.IndexCount);
        }
開發者ID:ZeusAFK,項目名稱:Keystone,代碼行數:24,代碼來源:PmxMaterial.cs

示例3: WriteString

 internal void WriteString(BinaryWriter bw, string value)
 {
     bw.WriteSizedBuffer(this.Header.Encoding.GetBytes(value));
 }
開發者ID:mfakane,項目名稱:Keystone,代碼行數:4,代碼來源:PmxDocument.cs

示例4: Write

        public void Write(Stream stream)
        {
            // leave open
            var bw = new BinaryWriter(stream);
            var buf = new byte[30];

            Encoding.GetEncoding(932).GetBytes(DisplayName, 0, DisplayName.Length, buf, 0);
            bw.Write(buf);
            bw.Write(this.Version);
            bw.Write((byte)(this.Encoding.CodePage == Encoding.Unicode.CodePage ? 0 : 1));

            bw.WriteSizedBuffer(this.Encoding.GetBytes(this.ObjectName));
            bw.WriteSizedBuffer(this.Encoding.GetBytes(this.ObjectName));
            bw.Write(this.KeyFps);
            bw.WriteSizedBuffer(new byte[0]);

            foreach (var i in this.Sections)
                i.Write(this, bw);

            bw.Write((byte)MvdTag.Eof);
            bw.Write((byte)0);
        }
開發者ID:ZeusAFK,項目名稱:Keystone,代碼行數:22,代碼來源:MvdDocument.cs

示例5: Write

        public virtual void Write(MvdDocument document, BinaryWriter bw)
        {
            bw.Write((byte)this.Tag);
            bw.Write(this.MinorType);
            bw.Write(this.RawKey);
            bw.Write(this.RawItemSize);
            bw.Write(this.RawCount);

            using (var ms = new MemoryStream())
            {
                using (var exw = new BinaryWriter(ms))
                    WriteExtensionRegion(document, exw);

                bw.WriteSizedBuffer(ms.ToArray());
            }
        }
開發者ID:mfakane,項目名稱:Keystone,代碼行數:16,代碼來源:MvdSection.cs


注:本文中的System.IO.BinaryWriter.WriteSizedBuffer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。