Beispiel #1
0
        /// <summary>
        /// DeSerialize this Collection's Meta Info
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="reader"></param>
        public virtual void Unpack(IInternalPersistent parent, System.IO.BinaryReader reader)
        {
            long da = reader.ReadInt64();

            if (da >= 0)
            {
                DataAddress = da;
            }
            DataBlockSize  = (DataBlockSize)reader.ReadInt32();
            Name           = reader.ReadString();
            HintSizeOnDisk = reader.ReadInt32();
            long l = reader.ReadInt64();

            if (l >= 0)
            {
                DataBlockDriver.SetId(this.DiskBuffer, l);
            }
            bool hasHeader = reader.ReadBoolean();

            if (hasHeader)
            {
                if (HeaderData == null)
                {
                    HeaderData = new HeaderData();
                }
                HeaderData.Unpack(parent, reader);
            }

            MruMinCapacity = ((CollectionOnDisk)parent).File.Profile.MruMinCapacity;
            MruMaxCapacity = ((CollectionOnDisk)parent).File.Profile.MruMaxCapacity;

            bool hasDeletedBlocks = reader.ReadBoolean();

            if (hasDeletedBlocks)
            {
                _deletedBlocksAddress = reader.ReadInt64();
            }
            else if (deletedBlocks != null)
            {
                deletedBlocks = null;
            }
        }
Beispiel #2
0
 /// <summary>
 /// Set Block ID to a given Address
 /// </summary>
 /// <param name="block"></param>
 /// <param name="address"></param>
 public void SetId(Sop.DataBlock block, long address)
 {
     DataBlockDriver.SetId(block, address);
 }