/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
        private UUIDFieldMetadata.DatabaseIdentityIDAndUUID ReadDatabaseIdentityIDAndUUID
            (ObjectContainerBase container, ClassMetadata classMetadata, Slot oldSlot, bool
            checkClass)
        {
            if (DTrace.enabled)
            {
                DTrace.RereadOldUuid.LogLength(oldSlot.Address(), oldSlot.Length());
            }
            ByteArrayBuffer reader = container.DecryptedBufferByAddress(oldSlot.Address(), oldSlot
                                                                        .Length());

            if (checkClass)
            {
                ClassMetadata realClass = ClassMetadata.ReadClass(container, reader);
                if (realClass != classMetadata)
                {
                    return(null);
                }
            }
            if (classMetadata.SeekToField(container.Transaction, reader, this) == HandlerVersion
                .Invalid)
            {
                return(null);
            }
            return(new UUIDFieldMetadata.DatabaseIdentityIDAndUUID(reader.ReadInt(), reader.ReadLong
                                                                       ()));
        }
        public long ReadLong()
        {
            long value = _source.ReadLong();

            _target.IncrementOffset(Const4.LongLength);
            return(value);
        }
		public override object ReadLong(ByteArrayBuffer buffer)
		{
			long value = buffer.ReadLong();
			if (value == long.MaxValue)
			{
				return null;
			}
			return value;
		}
		public override DateTime ReadDate(ByteArrayBuffer bytes)
		{
			long value = bytes.ReadLong();
			if (value == long.MaxValue)
			{
				return MarshallingConstants0.NullDate;
			}
			return new DateTime(value);
		}
		public virtual void ReadThis(ByteArrayBuffer buffer)
		{
			SystemData().ConverterVersion(buffer.ReadInt());
			SystemData().FreespaceSystem(buffer.ReadByte());
			buffer.ReadInt();
			// was BTreeFreespaceId, converted to slot, can no longer be used
			SystemData().IdentityId(buffer.ReadInt());
			SystemData().LastTimeStampID(buffer.ReadLong());
			SystemData().UuidIndexId(buffer.ReadInt());
		}
Exemple #6
0
		protected virtual void CheckThreadFileLock(LocalObjectContainer container, ByteArrayBuffer
			 reader)
		{
			reader.Seek(AccessTimeOffset);
			long lastAccessTime = reader.ReadLong();
			if (FileHeader.LockedByOtherSession(container, lastAccessTime))
			{
				_timerFileLock.CheckIfOtherSessionAlive(container, 0, AccessTimeOffset, lastAccessTime
					);
			}
		}
		internal override object Read1(ByteArrayBuffer a_bytes)
		{
			return a_bytes.ReadLong();
		}
		public override object ReadLong(ByteArrayBuffer buffer)
		{
			return buffer.ReadLong();
		}
		public override DateTime ReadDate(ByteArrayBuffer bytes)
		{
			return new DateTime(bytes.ReadLong());
		}
Exemple #10
0
    	public object ReadIndexEntry(IContext context, ByteArrayBuffer reader)
    	{
    		return new IndexEntry(reader.ReadInt(), reader.ReadLong());
		}
		public static double UnmarshalDouble(ByteArrayBuffer buffer)
		{
			return Platform4.LongToDouble(buffer.ReadLong());
		}
			public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer reader)
			{
				return new CommitTimestampSupport.TimestampEntry(reader.ReadInt(), reader.ReadLong
					());
			}
Exemple #13
0
 public virtual object ReadIndexEntry(IContext context, ByteArrayBuffer reader)
 {
     return(new CommitTimestampSupport.TimestampEntry(reader.ReadInt(), reader.ReadLong
                                                          ()));
 }
		private bool CheckSumOK(ByteArrayBuffer buffer, int offset)
		{
			int initialOffSet = buffer.Offset();
			int length = OwnLength();
			length -= ChecksumLength;
			buffer.Seek(offset);
			long readCheckSum = buffer.ReadLong();
			int checkSumBeginOffset = buffer.Offset();
			byte[] bytes = buffer._buffer;
			long calculatedCheckSum = CRC32.CheckSum(bytes, checkSumBeginOffset, length);
			buffer.Seek(initialOffSet);
			return calculatedCheckSum == readCheckSum;
		}
		protected virtual void ReadBuffer(ByteArrayBuffer buffer, bool versionsAreConsistent
			)
		{
			buffer.IncrementOffset(ChecksumLength);
			SystemData systemData = SystemData();
			systemData.IdSystemSlot(ReadSlot(buffer, false));
			systemData.InMemoryFreespaceSlot(ReadSlot(buffer, !versionsAreConsistent));
			systemData.BTreeFreespaceId(buffer.ReadInt());
			systemData.ConverterVersion(buffer.ReadInt());
			systemData.UuidIndexId(buffer.ReadInt());
			systemData.IdentityId(buffer.ReadInt());
			systemData.LastTimeStampID(buffer.ReadLong());
			systemData.FreespaceSystem(buffer.ReadByte());
		}