示例#1
0
 public override object ReadLong(ByteArrayBuffer buffer)
 {
     var value = buffer.ReadLong();
     if (value == long.MaxValue)
     {
         return null;
     }
     return value;
 }
示例#2
0
 public override DateTime ReadDate(ByteArrayBuffer bytes)
 {
     var value = bytes.ReadLong();
     if (value == long.MaxValue)
     {
         return MarshallingConstants0.NullDate;
     }
     return new DateTime(value);
 }
        public override DateTime ReadDate(ByteArrayBuffer bytes)
        {
            long value = bytes.ReadLong();

            if (value == long.MaxValue)
            {
                return(MarshallingConstants0.NullDate);
            }
            return(new DateTime(value));
        }
        public override object ReadLong(ByteArrayBuffer buffer)
        {
            long value = buffer.ReadLong();

            if (value == long.MaxValue)
            {
                return(null);
            }
            return(value);
        }
示例#5
0
 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());
 }
 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());
 }
示例#7
0
 protected virtual void CheckThreadFileLock(LocalObjectContainer container, ByteArrayBuffer
     reader)
 {
     reader.Seek(AccessTimeOffset);
     var lastAccessTime = reader.ReadLong();
     if (LockedByOtherSession(container, lastAccessTime))
     {
         _timerFileLock.CheckIfOtherSessionAlive(container, 0, AccessTimeOffset, lastAccessTime
             );
     }
 }
示例#8
0
        private bool CheckSumOK(ByteArrayBuffer buffer, int offset)
        {
            var initialOffSet = buffer.Offset();
            var length        = OwnLength();

            length -= ChecksumLength;
            buffer.Seek(offset);
            var readCheckSum        = buffer.ReadLong();
            var checkSumBeginOffset = buffer.Offset();
            var bytes = buffer._buffer;
            var 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());
        }
示例#10
0
 public virtual long ReadLong()
 {
     return(_current.ReadLong());
 }
示例#11
0
 public override object ReadLong(ByteArrayBuffer buffer)
 {
     return(buffer.ReadLong());
 }
示例#12
0
 public override DateTime ReadDate(ByteArrayBuffer bytes)
 {
     return(new DateTime(bytes.ReadLong()));
 }
 public static double UnmarshalDouble(ByteArrayBuffer buffer)
 {
     return(Platform4.LongToDouble(buffer.ReadLong()));
 }
示例#14
0
 internal override object Read1(ByteArrayBuffer a_bytes)
 {
     return(a_bytes.ReadLong());
 }
示例#15
0
 public override DateTime ReadDate(ByteArrayBuffer bytes)
 {
     return new DateTime(bytes.ReadLong());
 }
示例#16
0
 public static double UnmarshalDouble(ByteArrayBuffer buffer)
 {
     return Platform4.LongToDouble(buffer.ReadLong());
 }
示例#17
0
 public object ReadIndexEntry(IContext context, ByteArrayBuffer reader)
 {
     return(new IndexEntry(reader.ReadInt(), reader.ReadLong()));
 }
示例#18
0
 public override object ReadLong(ByteArrayBuffer buffer)
 {
     return buffer.ReadLong();
 }
示例#19
0
 internal override object Read1(ByteArrayBuffer a_bytes)
 {
     return a_bytes.ReadLong();
 }
示例#20
0
 protected virtual void ReadBuffer(ByteArrayBuffer buffer, bool versionsAreConsistent
     )
 {
     buffer.IncrementOffset(ChecksumLength);
     var 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());
 }
示例#21
0
 private bool CheckSumOK(ByteArrayBuffer buffer, int offset)
 {
     var initialOffSet = buffer.Offset();
     var length = OwnLength();
     length -= ChecksumLength;
     buffer.Seek(offset);
     var readCheckSum = buffer.ReadLong();
     var checkSumBeginOffset = buffer.Offset();
     var bytes = buffer._buffer;
     var calculatedCheckSum = CRC32.CheckSum(bytes, checkSumBeginOffset, length);
     buffer.Seek(initialOffSet);
     return calculatedCheckSum == readCheckSum;
 }