本文整理汇总了C#中Microsoft.Cci.Pdb.BitAccess.WriteInt32方法的典型用法代码示例。如果您正苦于以下问题:C# BitAccess.WriteInt32方法的具体用法?C# BitAccess.WriteInt32怎么用?C# BitAccess.WriteInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Cci.Pdb.BitAccess
的用法示例。
在下文中一共展示了BitAccess.WriteInt32方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteDirectory
private void WriteDirectory(DataStream[] streams,
out int directoryRoot,
out int directorySize,
BitAccess bits) {
DataStream directory = new DataStream();
int pages = 0;
for (int s = 0; s < streams.Length; s++) {
if (streams[s].Length > 0) {
pages += streams[s].Pages;
}
}
int use = 4 * (1 + streams.Length + pages);
bits.MinCapacity(use);
bits.WriteInt32(streams.Length);
for (int s = 0; s < streams.Length; s++) {
bits.WriteInt32(streams[s].Length);
}
for (int s = 0; s < streams.Length; s++) {
if (streams[s].Length > 0) {
bits.WriteInt32(streams[s].pages);
}
}
directory.Write(this, bits.Buffer, use);
directorySize = directory.Length;
use = 4 * directory.Pages;
bits.MinCapacity(use);
bits.WriteInt32(directory.pages);
DataStream ddir = new DataStream();
ddir.Write(this, bits.Buffer, use);
directoryRoot = ddir.pages[0];
}
示例2: Write
internal void Write(Stream writer, BitAccess bits) {
bits.MinCapacity(56);
bits.WriteBytes(magic); // 0..31
bits.WriteInt32(pageSize); // 32..35
bits.WriteInt32(freePageMap); // 36..39
bits.WriteInt32(pagesUsed); // 40..43
bits.WriteInt32(directorySize); // 44..47
bits.WriteInt32(zero); // 48..51
bits.WriteInt32(directoryRoot); // 52..55
writer.Seek(0, SeekOrigin.Begin);
bits.WriteBuffer(writer, 56);
}