本文整理汇总了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);
}
}
示例2: WriteToStream
public void WriteToStream(Stream stream)
{
BinaryWriter bw = new BinaryWriter(stream);
bw.WriteBig(Unknown1);
bw.WriteBig(Unknown2);
bw.WriteBig(Unknown3);
bw.WriteBig(Unknown4);
}
示例3: WriteToStream
public void WriteToStream(Stream stream)
{
BinaryWriter bw = new BinaryWriter(stream);
bw.WriteBig(PackageNameOffset);
bw.WriteBig(Length);
bw.WriteBig(Dummy);
bw.WriteBig(Offset);
}
示例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);
}
示例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);
}
示例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();
}
示例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]);
}
示例8: WriteToStream
public unsafe void WriteToStream(Stream output)
{
BinaryWriter bw = new BinaryWriter(output);
bw.WriteBig(BlockSize);
if (BlockSize > 0)
throw new NotImplementedException();
}
示例9: WriteToStream
public void WriteToStream(Stream stream)
{
BinaryWriter bw = new BinaryWriter(stream);
bw.WriteBig(Offset);
bw.WriteBig(Length);
}