本文整理汇总了C#中ByteReader.ReadUInt16方法的典型用法代码示例。如果您正苦于以下问题:C# ByteReader.ReadUInt16方法的具体用法?C# ByteReader.ReadUInt16怎么用?C# ByteReader.ReadUInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ByteReader
的用法示例。
在下文中一共展示了ByteReader.ReadUInt16方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadContent
protected override void ReadContent(ByteReader reader)
{
this.Nodes = new Dictionary<ushort, IndexNode>(this.ItemCount);
for (var i = 0; i < this.ItemCount; i++)
{
var index = reader.ReadUInt16();
var levels = reader.ReadByte();
var node = new IndexNode(levels);
node.Page = this;
node.Position = new PageAddress(this.PageID, index);
node.KeyLength = reader.ReadUInt16();
node.Key = reader.ReadBsonValue(node.KeyLength);
node.DataBlock = reader.ReadPageAddress();
for (var j = 0; j < node.Prev.Length; j++)
{
node.Prev[j] = reader.ReadPageAddress();
node.Next[j] = reader.ReadPageAddress();
}
this.Nodes.Add(node.Position.Index, node);
}
}
示例2: ReadContent
protected override void ReadContent(ByteReader reader)
{
this.DataBlocks = new Dictionary<ushort, DataBlock>(ItemCount);
for (var i = 0; i < ItemCount; i++)
{
var block = new DataBlock();
block.Page = this;
block.Position = new PageAddress(this.PageID, reader.ReadUInt16());
block.ExtendPageID = reader.ReadUInt32();
for (var j = 0; j < CollectionIndex.INDEX_PER_COLLECTION; j++)
{
block.IndexRef[j] = reader.ReadPageAddress();
}
var size = reader.ReadUInt16();
block.Data = reader.ReadBytes(size);
this.DataBlocks.Add(block.Position.Index, block);
}
}
示例3: ReadContent
protected override void ReadContent(ByteReader reader)
{
var info = reader.ReadString(HEADER_INFO.Length);
var ver = reader.ReadByte();
if (info != HEADER_INFO) throw LiteException.InvalidDatabase();
if (ver != FILE_VERSION) throw LiteException.InvalidDatabaseVersion(ver);
this.ChangeID = reader.ReadUInt16();
this.FreeEmptyPageID = reader.ReadUInt32();
this.LastPageID = reader.ReadUInt32();
this.DbVersion = reader.ReadUInt16();
this.Password = reader.ReadBytes(this.Password.Length);
// read page collections references (position on end of page)
var cols = reader.ReadByte();
for (var i = 0; i < cols; i++)
{
this.CollectionPages.Add(reader.ReadString(), reader.ReadUInt32());
}
}
示例4: Read
public void Read(ByteReader reader)
{
this.DbVersion = reader.ReadUInt16();
this.Password = reader.ReadBytes(20);
reader.Skip(178);
}