本文整理汇总了C#中ByteArrayBuffer.IncrementOffset方法的典型用法代码示例。如果您正苦于以下问题:C# ByteArrayBuffer.IncrementOffset方法的具体用法?C# ByteArrayBuffer.IncrementOffset怎么用?C# ByteArrayBuffer.IncrementOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ByteArrayBuffer
的用法示例。
在下文中一共展示了ByteArrayBuffer.IncrementOffset方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompleteInterruptedTransaction
public override void CompleteInterruptedTransaction(int transactionId1, int transactionId2
)
{
if (!File.Exists(LockFileName(_fileName)))
{
return;
}
if (!LockFileSignalsInterruptedTransaction())
{
return;
}
var buffer = new ByteArrayBuffer(Const4.IntLength);
OpenLogFile();
Read(_logFile, buffer);
var length = buffer.ReadInt();
if (length > 0)
{
buffer = new ByteArrayBuffer(length);
Read(_logFile, buffer);
buffer.IncrementOffset(Const4.IntLength);
ReadWriteSlotChanges(buffer);
}
DeleteLockFile();
CloseLogFile();
DeleteLogFile();
}
示例2: ReadName
private byte[] ReadName(LatinStringIO sio, ByteArrayBuffer reader)
{
var nameBytes = sio.Bytes(reader);
reader.IncrementOffset(nameBytes.Length);
nameBytes = Platform4.UpdateClassName(nameBytes);
return nameBytes;
}
示例3: ReadSpec
public virtual RawClassSpec ReadSpec(Transaction trans, ByteArrayBuffer reader)
{
var nameBytes = ReadName(trans, reader);
var className = trans.Container().StringIO().Read(nameBytes);
ReadMetaClassID(reader);
// skip
var ancestorID = reader.ReadInt();
reader.IncrementOffset(Const4.IntLength);
// index ID
var numFields = reader.ReadInt();
return new RawClassSpec(className, ancestorID, numFields);
}
示例4: ReadThis
public override void ReadThis(Transaction a_trans, ByteArrayBuffer a_reader)
{
a_reader.IncrementOffset(1);
// first byte is version, for possible future format changes
_size = a_reader.ReadInt();
_nodeSize = a_reader.ReadInt();
_halfNodeSize = NodeSize()/2;
_root = ProduceNode(a_reader.ReadInt());
}
示例5: SkipMarshallerInfo
public virtual void SkipMarshallerInfo(ByteArrayBuffer reader)
{
reader.IncrementOffset(1);
}
示例6: WriteThis
public override void WriteThis(Transaction trans, ByteArrayBuffer buffer)
{
var count = 0;
var startOffset = buffer._offset;
var context = trans.Context();
buffer.IncrementOffset(CountLeafAnd3LinkLength);
if (_isLeaf)
{
for (var i = 0; i < _count; i++)
{
var obj = InternalKey(trans, i);
if (obj != No4.Instance)
{
count++;
KeyHandler().WriteIndexEntry(context, buffer, obj);
}
}
}
else
{
for (var i = 0; i < _count; i++)
{
if (ChildCanSupplyFirstKey(i))
{
var child = (BTreeNode
) _children[i];
var childKey = child.FirstKey(trans);
if (childKey != No4.Instance)
{
count++;
KeyHandler().WriteIndexEntry(context, buffer, childKey);
buffer.WriteIDOf(trans, child);
}
}
else
{
count++;
KeyHandler().WriteIndexEntry(context, buffer, Key(i));
buffer.WriteIDOf(trans, _children[i]);
}
}
}
var endOffset = buffer._offset;
buffer._offset = startOffset;
buffer.WriteInt(count);
buffer.WriteByte(_isLeaf ? (byte) 1 : (byte) 0);
buffer.WriteInt(_parentID);
buffer.WriteInt(_previousID);
buffer.WriteInt(_nextID);
buffer._offset = endOffset;
}
示例7: Marshall
private void Marshall(ByteArrayBuffer buffer, bool shuttingDown)
{
var checkSumOffset = buffer.Offset();
buffer.IncrementOffset(ChecksumLength);
var checkSumBeginOffset = buffer.Offset();
WriteBuffer(buffer, shuttingDown);
var checkSumEndOffSet = buffer.Offset();
var bytes = buffer._buffer;
var length = checkSumEndOffSet - checkSumBeginOffset;
var checkSum = CRC32.CheckSum(bytes, checkSumBeginOffset, length);
buffer.Seek(checkSumOffset);
buffer.WriteLong(checkSum);
buffer.Seek(checkSumEndOffSet);
}
示例8: ReadBuffer
protected virtual void ReadBuffer(ByteArrayBuffer buffer, bool versionsAreConsistent
)
{
buffer.IncrementOffset(ChecksumLength);
var systemData = SystemData();
systemData.IdSystemSlot(ReadSlot(buffer, false));
systemData.InMemoryFreespaceSlot(ReadSlot(buffer, !versionsAreConsistent));
systemData.BTreeFreespaceId(buffer.ReadInt());
systemData.ConverterVersion(buffer.ReadInt());
systemData.UuidIndexId(buffer.ReadInt());
systemData.IdentityId(buffer.ReadInt());
systemData.LastTimeStampID(buffer.ReadLong());
systemData.FreespaceSystem(buffer.ReadByte());
}