Ejemplo n.º 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);
 }
Ejemplo n.º 2
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);
 }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
 public override void Write(object a_object, ByteArrayBuffer a_bytes)
 {
     a_bytes.WriteLong(Platform4.DoubleToLong(((double)a_object)));
 }
Ejemplo n.º 7
0
 public override void Write(object a_object, ByteArrayBuffer a_bytes)
 {
     a_bytes.WriteLong(Platform4.DoubleToLong(((double) a_object)));
 }
Ejemplo n.º 8
0
 public virtual void WriteLong(long l)
 {
     _current.WriteLong(l);
 }
Ejemplo n.º 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());
 }
Ejemplo n.º 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);
 }