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


C# ByteArrayBuffer.WriteInt方法代码示例

本文整理汇总了C#中ByteArrayBuffer.WriteInt方法的典型用法代码示例。如果您正苦于以下问题:C# ByteArrayBuffer.WriteInt方法的具体用法?C# ByteArrayBuffer.WriteInt怎么用?C# ByteArrayBuffer.WriteInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ByteArrayBuffer的用法示例。


在下文中一共展示了ByteArrayBuffer.WriteInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteIndexEntry

 public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object
     obj)
 {
     var slot = (Slot) obj;
     writer.WriteInt(slot.Address());
     writer.WriteInt(slot.Length());
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:SlotHandler.cs

示例2: WriteBuffer

 protected override void WriteBuffer(ByteArrayBuffer buffer, bool shuttingDown)
 {
     base.WriteBuffer(buffer, shuttingDown);
     var systemData = SystemData();
     buffer.WriteInt(systemData.IdToTimestampIndexId());
     buffer.WriteInt(systemData.TimestampToIdIndexId());
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:FileHeaderVariablePart3.cs

示例3: Write

 public virtual void Write(Transaction trans, ClassMetadata clazz, ByteArrayBuffer
     writer)
 {
     writer.WriteShortString(trans, clazz.NameToWrite());
     var intFormerlyKnownAsMetaClassID = 0;
     writer.WriteInt(intFormerlyKnownAsMetaClassID);
     writer.WriteIDOf(trans, clazz._ancestor);
     WriteIndex(trans, clazz, writer);
     writer.WriteInt(clazz.DeclaredAspectCount());
     clazz.TraverseDeclaredAspects(new _IProcedure4_39(this, trans, clazz, writer));
 }
开发者ID:masroore,项目名称:db4o,代码行数:11,代码来源:ClassMarshaller.cs

示例4: Write

 public override void Write(ByteArrayBuffer a_writer)
 {
     // byte order: size, address
     a_writer.WriteInt(_key);
     a_writer.WriteInt(_peer._key);
 }
开发者ID:masroore,项目名称:db4o,代码行数:6,代码来源:FreeSlotNode.cs

示例5: WriteObjectClassID

 public override void WriteObjectClassID(ByteArrayBuffer buffer, int id)
 {
     buffer.WriteInt(id);
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:SlotFormat0.cs

示例6: WriteObjectClassID

 public virtual void WriteObjectClassID(ByteArrayBuffer buffer, int id)
 {
     buffer.WriteInt(-id);
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:SlotFormat.cs

示例7: WriteThis

 public override void WriteThis(Transaction trans, ByteArrayBuffer a_writer)
 {
     a_writer.WriteByte(BtreeVersion);
     a_writer.WriteInt(_size);
     a_writer.WriteInt(NodeSize());
     a_writer.WriteIDOf(trans, _root);
 }
开发者ID:masroore,项目名称:db4o,代码行数:7,代码来源:BTree.cs

示例8: WriteIndexEntry

 public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object
     entry)
 {
     if (entry == null)
     {
         writer.WriteInt(0);
         writer.WriteInt(0);
         return;
     }
     if (entry is StatefulBuffer)
     {
         var entryAsWriter = (StatefulBuffer) entry;
         writer.WriteInt(entryAsWriter.GetAddress());
         writer.WriteInt(entryAsWriter.Length());
         return;
     }
     if (entry is Slot)
     {
         var s = (Slot) entry;
         writer.WriteInt(s.Address());
         writer.WriteInt(s.Length());
         return;
     }
     throw new ArgumentException();
 }
开发者ID:masroore,项目名称:db4o,代码行数:25,代码来源:StringHandler.cs

示例9: WriteObjectClassID

 private void WriteObjectClassID(ByteArrayBuffer reader, int id)
 {
     reader.WriteInt(-id);
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:MarshallingContext.cs

示例10: WriteBuffer

 protected virtual void WriteBuffer(ByteArrayBuffer buffer, bool shuttingDown)
 {
     var systemData = SystemData();
     WriteSlot(buffer, systemData.IdSystemSlot(), false);
     WriteSlot(buffer, systemData.InMemoryFreespaceSlot(), !shuttingDown);
     buffer.WriteInt(systemData.BTreeFreespaceId());
     buffer.WriteInt(systemData.ConverterVersion());
     buffer.WriteInt(systemData.UuidIndexId());
     var identity = systemData.Identity();
     buffer.WriteInt(identity == null
         ? 0
         : identity.GetID(_container.SystemTransaction
             ()));
     buffer.WriteLong(systemData.LastTimeStampID());
     buffer.WriteByte(systemData.FreespaceSystem());
 }
开发者ID:masroore,项目名称:db4o,代码行数:16,代码来源:FileHeaderVariablePart2.cs

示例11: Write

 public virtual void Write(ByteArrayBuffer buffer)
 {
     buffer.WriteInt(PersistentGeneratorValue());
 }
开发者ID:masroore,项目名称:db4o,代码行数:4,代码来源:SequentialIdGenerator.cs

示例12: ApplySlotChanges

 public override void ApplySlotChanges(IVisitable slotChangeTree, int slotChangeCount
     , Slot reservedSlot)
 {
     if (slotChangeCount < 1)
     {
         return;
     }
     var commitHook = _container.CommitHook();
     FlushDatabaseFile();
     EnsureLogAndLock();
     var length = TransactionLogSlotLength(slotChangeCount);
     var logBuffer = new ByteArrayBuffer(length);
     logBuffer.WriteInt(length);
     logBuffer.WriteInt(slotChangeCount);
     AppendSlotChanges(logBuffer, slotChangeTree);
     Write(_logFile, logBuffer);
     _logFile.Sync();
     WriteToLockFile(LockInt);
     WriteSlots(slotChangeTree);
     commitHook.Run();
     FlushDatabaseFile();
     WriteToLockFile(0);
 }
开发者ID:masroore,项目名称:db4o,代码行数:23,代码来源:FileBasedTransactionLogHandler.cs

示例13: Write

 public virtual void Write(ByteArrayBuffer buffer)
 {
     buffer.WriteInt(_id);
     buffer.WriteInt(Length());
     buffer.Append(_bytes);
 }
开发者ID:masroore,项目名称:db4o,代码行数:6,代码来源:SerializedGraph.cs

示例14: Write

 public override void Write(Transaction trans, ClassMetadata clazz, ClassAspect aspect
     , ByteArrayBuffer writer)
 {
     writer.WriteShortString(trans, aspect.GetName());
     if (!(aspect is FieldMetadata))
     {
         return;
     }
     var field = (FieldMetadata) aspect;
     field.Alive();
     if (field.IsVirtual())
     {
         return;
     }
     var handler = field.GetHandler();
     if (handler is StandardReferenceTypeHandler)
     {
         // TODO: ensure there is a test case, to make this happen 
         if (((StandardReferenceTypeHandler) handler).ClassMetadata().GetID() == 0)
         {
             trans.Container().NeedsUpdate(clazz);
         }
     }
     writer.WriteInt(field.FieldTypeID());
     var bitmap = new BitMap4(3);
     bitmap.Set(0, field.IsPrimitive());
     bitmap.Set(1, Handlers4.HandlesArray(handler));
     bitmap.Set(2, Handlers4.HandlesMultidimensionalArray(handler));
     // keep the order
     writer.WriteByte(bitmap.GetByte(0));
 }
开发者ID:masroore,项目名称:db4o,代码行数:31,代码来源:FieldMarshaller0.cs

示例15: WriteThis

 private void WriteThis(Slot reservedSlot)
 {
     // We need a little dance here to keep filling free slots
     // with X bytes. The FreespaceManager would do it immediately
     // upon the free call, but then our CrashSimulatingTestCase
     // fails because we have the Xses in the file before flushing.
     Slot xByteSlot = null;
     var slotLength = SlotLength();
     if (reservedSlot.Length() >= slotLength)
     {
         _slot = reservedSlot;
         reservedSlot = null;
     }
     else
     {
         _slot = AllocateSlot(true, slotLength);
     }
     var buffer = new ByteArrayBuffer(_slot.Length());
     buffer.WriteInt(_childId);
     _idGenerator.Write(buffer);
     TreeInt.Write(buffer, _ids);
     _container.WriteBytes(buffer, _slot.Address(), 0);
     _container.SystemData().IdSystemSlot(_slot);
     var commitHook = _container.CommitHook();
     _container.SyncFiles(commitHook);
     FreeSlot(reservedSlot);
 }
开发者ID:masroore,项目名称:db4o,代码行数:27,代码来源:InMemoryIdSystem.cs


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