本文整理汇总了C#中ByteArrayBuffer.WriteLong方法的典型用法代码示例。如果您正苦于以下问题:C# ByteArrayBuffer.WriteLong方法的具体用法?C# ByteArrayBuffer.WriteLong怎么用?C# ByteArrayBuffer.WriteLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ByteArrayBuffer
的用法示例。
在下文中一共展示了ByteArrayBuffer.WriteLong方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Write
public override void Write(object a_object, ByteArrayBuffer a_bytes)
{
// TODO: This is a temporary fix to prevent exceptions with
// Marshaller.LEGACY.
if (a_object == null)
{
a_object = new DateTime(0);
}
a_bytes.WriteLong(((DateTime) a_object).Ticks);
}
示例2: Write
public override void Write(object a_object, ByteArrayBuffer a_bytes)
{
a_bytes.WriteLong(Platform4.DoubleToLong(((double) a_object)));
}
示例3: 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());
}
示例4: 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);
}