本文整理汇总了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);
}
示例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);
}
示例3: WriteString
internal void WriteString(BinaryWriter bw, string value)
{
bw.WriteSizedBuffer(this.Header.Encoding.GetBytes(value));
}
示例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);
}
示例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());
}
}