当前位置: 首页>>代码示例>>C#>>正文


C# ByteArrayBuffer.IncrementOffset方法代码示例

本文整理汇总了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();
 }
开发者ID:masroore,项目名称:db4o,代码行数:26,代码来源:FileBasedTransactionLogHandler.cs

示例2: ReadName

 private byte[] ReadName(LatinStringIO sio, ByteArrayBuffer reader)
 {
     var nameBytes = sio.Bytes(reader);
     reader.IncrementOffset(nameBytes.Length);
     nameBytes = Platform4.UpdateClassName(nameBytes);
     return nameBytes;
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:ClassMarshaller.cs

示例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);
 }
开发者ID:masroore,项目名称:db4o,代码行数:12,代码来源:ClassMarshaller.cs

示例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());
 }
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:BTree.cs

示例5: SkipMarshallerInfo

 public virtual void SkipMarshallerInfo(ByteArrayBuffer reader)
 {
     reader.IncrementOffset(1);
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:SlotFormat.cs

示例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;
 }
开发者ID:masroore,项目名称:db4o,代码行数:51,代码来源:BTreeNode.cs

示例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);
 }
开发者ID:masroore,项目名称:db4o,代码行数:14,代码来源:FileHeaderVariablePart2.cs

示例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());
 }
开发者ID:masroore,项目名称:db4o,代码行数:14,代码来源:FileHeaderVariablePart2.cs


注:本文中的ByteArrayBuffer.IncrementOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。