コード例 #1
0
 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
0
ファイル: DateHandlerBase.cs プロジェクト: masroore/db4o
 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);
 }
コード例 #3
0
ファイル: EnumTypeHandler.cs プロジェクト: pondyond/db4o
        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);
        }
コード例 #4
0
        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());
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 public override void Write(object a_object, ByteArrayBuffer a_bytes)
 {
     a_bytes.WriteLong(Platform4.DoubleToLong(((double)a_object)));
 }
コード例 #7
0
ファイル: DoubleHandler.cs プロジェクト: masroore/db4o
 public override void Write(object a_object, ByteArrayBuffer a_bytes)
 {
     a_bytes.WriteLong(Platform4.DoubleToLong(((double) a_object)));
 }
コード例 #8
0
 public virtual void WriteLong(long l)
 {
     _current.WriteLong(l);
 }
コード例 #9
0
 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());
 }
コード例 #10
0
 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);
 }