本文整理汇总了C#中Db4objects.Db4o.Internal.ByteArrayBuffer.IncrementOffset方法的典型用法代码示例。如果您正苦于以下问题:C# ByteArrayBuffer.IncrementOffset方法的具体用法?C# ByteArrayBuffer.IncrementOffset怎么用?C# ByteArrayBuffer.IncrementOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Internal.ByteArrayBuffer
的用法示例。
在下文中一共展示了ByteArrayBuffer.IncrementOffset方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompleteInterruptedTransaction
public override void CompleteInterruptedTransaction(int transactionId1, int transactionId2
)
{
if (!System.IO.File.Exists(LockFileName(_fileName)))
{
return;
}
if (!LockFileSignalsInterruptedTransaction())
{
return;
}
ByteArrayBuffer buffer = new ByteArrayBuffer(Const4.IntLength);
OpenLogFile();
Read(_logFile, buffer);
int length = buffer.ReadInt();
if (length > 0)
{
buffer = new ByteArrayBuffer(length);
Read(_logFile, buffer);
buffer.IncrementOffset(Const4.IntLength);
ReadWriteSlotChanges(buffer);
}
DeleteLockFile();
CloseLogFile();
DeleteLogFile();
}
示例2: ReadSpec
public virtual RawClassSpec ReadSpec(Transaction trans, ByteArrayBuffer reader)
{
byte[] nameBytes = ReadName(trans, reader);
string className = trans.Container().StringIO().Read(nameBytes);
ReadMetaClassID(reader);
// skip
int ancestorID = reader.ReadInt();
reader.IncrementOffset(Const4.IntLength);
// index ID
int numFields = reader.ReadInt();
return new RawClassSpec(className, ancestorID, numFields);
}
示例3: ReadName
private byte[] ReadName(LatinStringIO sio, ByteArrayBuffer reader)
{
byte[] nameBytes = sio.Bytes(reader);
reader.IncrementOffset(nameBytes.Length);
nameBytes = Platform4.UpdateClassName(nameBytes);
return nameBytes;
}
示例4: SkipMarshallerInfo
public virtual void SkipMarshallerInfo(ByteArrayBuffer reader)
{
reader.IncrementOffset(1);
}
示例5: 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());
}
示例6: WriteThis
public override void WriteThis(Transaction trans, ByteArrayBuffer buffer)
{
int count = 0;
int startOffset = buffer._offset;
IContext context = trans.Context();
buffer.IncrementOffset(CountLeafAnd3LinkLength);
if (_isLeaf)
{
for (int i = 0; i < _count; i++)
{
object obj = InternalKey(trans, i);
if (obj != No4.Instance)
{
count++;
KeyHandler().WriteIndexEntry(context, buffer, obj);
}
}
}
else
{
for (int i = 0; i < _count; i++)
{
if (ChildCanSupplyFirstKey(i))
{
Db4objects.Db4o.Internal.Btree.BTreeNode child = (Db4objects.Db4o.Internal.Btree.BTreeNode
)_children[i];
object 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]);
}
}
}
int 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)
{
int checkSumOffset = buffer.Offset();
buffer.IncrementOffset(ChecksumLength);
int checkSumBeginOffset = buffer.Offset();
WriteBuffer(buffer, shuttingDown);
int checkSumEndOffSet = buffer.Offset();
byte[] bytes = buffer._buffer;
int length = checkSumEndOffSet - checkSumBeginOffset;
long 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);
SystemData 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());
}