public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { writer.WriteInt(((CommitTimestampSupport.TimestampEntry)obj).ParentID()); writer.WriteLong(((CommitTimestampSupport.TimestampEntry)obj).GetCommitTimestamp( )); }
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); }
public override void Write(object a_object, ByteArrayBuffer a_bytes) { a_bytes.WriteLong(Platform4.DoubleToLong(((double)a_object))); }
public virtual void WriteLong(long l) { PrepareWrite(); _delegate.WriteLong(l); }
public void WriteLong(long value) { _source.IncrementOffset(Const4.LongLength); _target.WriteLong(value); }
public virtual void WriteIndexEntry(IContext context, ByteArrayBuffer writer, object obj) { writer.WriteInt(((CommitTimestampSupport.TimestampEntry)obj).ParentID()); writer.WriteLong(((CommitTimestampSupport.TimestampEntry)obj).GetCommitTimestamp( )); }
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) { 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); }