本文整理汇总了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());
}
示例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());
}
示例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));
}
示例4: Write
public override void Write(ByteArrayBuffer a_writer)
{
// byte order: size, address
a_writer.WriteInt(_key);
a_writer.WriteInt(_peer._key);
}
示例5: WriteObjectClassID
public override void WriteObjectClassID(ByteArrayBuffer buffer, int id)
{
buffer.WriteInt(id);
}
示例6: WriteObjectClassID
public virtual void WriteObjectClassID(ByteArrayBuffer buffer, int id)
{
buffer.WriteInt(-id);
}
示例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);
}
示例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();
}
示例9: WriteObjectClassID
private void WriteObjectClassID(ByteArrayBuffer reader, int id)
{
reader.WriteInt(-id);
}
示例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());
}
示例11: Write
public virtual void Write(ByteArrayBuffer buffer)
{
buffer.WriteInt(PersistentGeneratorValue());
}
示例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);
}
示例13: Write
public virtual void Write(ByteArrayBuffer buffer)
{
buffer.WriteInt(_id);
buffer.WriteInt(Length());
buffer.Append(_bytes);
}
示例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));
}
示例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);
}