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


C# ByteArrayBuffer.IncrementOffset方法代码示例

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

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

示例3: ReadName

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

示例4: SkipMarshallerInfo

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

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

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

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

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


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