本文整理匯總了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());
}
}