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); }
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); }
public void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { var indexEntry = obj as IndexEntry; if (indexEntry == null) { indexEntry = new IndexEntry(ClassMetadataIdFor(context, obj), Convert.ToInt64(obj)); } writer.WriteInt(indexEntry.ClassMetadataId); writer.WriteLong(indexEntry.EnumValue); }
protected virtual void WriteBuffer(ByteArrayBuffer buffer, bool shuttingDown) { SystemData systemData = SystemData(); WriteSlot(buffer, systemData.IdSystemSlot(), false); WriteSlot(buffer, systemData.InMemoryFreespaceSlot(), !shuttingDown); buffer.WriteInt(systemData.BTreeFreespaceId()); buffer.WriteInt(systemData.ConverterVersion()); buffer.WriteInt(systemData.UuidIndexId()); Db4oDatabase identity = systemData.Identity(); buffer.WriteInt(identity == null ? 0 : identity.GetID(_container.SystemTransaction ())); buffer.WriteLong(systemData.LastTimeStampID()); buffer.WriteByte(systemData.FreespaceSystem()); }
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); }
public override void Write(object a_object, ByteArrayBuffer a_bytes) { a_bytes.WriteLong(Platform4.DoubleToLong(((double)a_object))); }
public override void Write(object a_object, ByteArrayBuffer a_bytes) { a_bytes.WriteLong(Platform4.DoubleToLong(((double) a_object))); }
public virtual void WriteLong(long l) { _current.WriteLong(l); }
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()); }