/// <summary>
        /// Deserialize the class data from a stream.
        /// </summary>
        /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param>
        /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream;
        /// the version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FullDataIdType
                FullDataIdType = (FullDataIdType)reader.ReadByte();

                //TagName
                TagName = reader.ReadString();

                if (version >= 2)
                {
                    //Offset
                    reader.ReadInt32();

                    //Count
                    reader.ReadInt32();

                    //DataType
                    DataType = (DataType)reader.ReadByte();

                    //FullDataIdFieldList
                    if (reader.ReadBoolean())
                    {
                        FullDataIdFieldList = new FullDataIdFieldList();
                        Serializer.Deserialize(reader.BaseStream, FullDataIdFieldList);
                    }

                    //FullDataIdPartFormat
                    FullDataIdPartFormat = (FullDataIdPartFormat)reader.ReadByte();
                }
            }
        }
Esempio n. 2
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //InclusiveMaxValue
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    InclusiveMaxValue = reader.ReadBytes(len);
                }

                //InclusiveMinvalue
                len = reader.ReadUInt16();
                if (len > 0)
                {
                    InclusiveMinValue = reader.ReadBytes(len);
                }

                if (version >= 2)
                {
                    //InclusiveMaxMetadataProperty
                    InclusiveMaxMetadataProperty = reader.ReadString();

                    //InclusiveMaxMetadataPropertyDataType
                    InclusiveMaxMetadataPropertyDataType = (DataType)reader.ReadByte();

                    //InclusiveMinMetadataProperty
                    InclusiveMinMetadataProperty = reader.ReadString();

                    //InclusiveMinMetadataPropertyDataType
                    InclusiveMinMetadataPropertyDataType = (DataType)reader.ReadByte();
                }
            }
        }
Esempio n. 3
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    IndexId = reader.ReadBytes(len);
                }

                //Count
                Count = reader.ReadInt32();

                //TargetIndexName
                TargetIndexName = reader.ReadString();

                //ExcludeData
                ExcludeData = reader.ReadBoolean();

                //GetMetadata
                GetMetadata = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    Filter = FilterFactory.CreateFilter(reader, filterType);
                }

                //FullDataIdInfo
                if (reader.ReadBoolean())
                {
                    FullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
                }

                //IndexCondition
                if (reader.ReadBoolean())
                {
                    IndexCondition = new IndexCondition();
                    Serializer.Deserialize(reader.BaseStream, IndexCondition);
                }

                if (version >= 2)
                {
                    //DomainSpecificProcessingType
                    DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
                }
            }
        }
Esempio n. 4
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }

                if (version >= 2)
                {
                    //Count
                    Count = reader.ReadInt32();

                    //IndexCondition
                    if (reader.ReadBoolean())
                    {
                        IndexCondition = new IndexCondition();
                        Serializer.Deserialize(reader.BaseStream, IndexCondition);
                    }
                }
            }
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //MultiItemResult
            if (reader.ReadByte() != 0)
            {
                multiItemResult = new MultiItemResult();
                multiItemResult.Deserialize(reader);
            }

            //Metadata
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                metadata = reader.ReadBytes(len);
            }

            //IndexSize
            indexSize = reader.ReadInt32();

            //IndexExists
            indexExists = reader.ReadBoolean();

            //ExceptionInfo
            exceptionInfo = reader.ReadString();

            //VirtualCount
            if (version >= 2)
            {
                virtualCount = reader.ReadInt32();
            }
        }
Esempio n. 6
0
        /// <summary>
        /// Deserialize the class data from a stream.
        /// </summary>
        /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param>
        /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream;
        /// the version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FieldValue
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    FieldValue = reader.ReadBytes(len);
                }
                else
                {
                    new LogWrapper().Error("FieldValue in FilterCaps cannot be null or zero length byte array");
                    throw new Exception("FieldValue in FilterCaps cannot be null or zero length byte array");
                }

                //UseParentFilter
                UseParentFilter = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    Filter = FilterFactory.CreateFilter(reader, (FilterType)b);
                }

                //Cap
                Cap = reader.ReadInt32();
            }
        }
        /// <summary>
        /// Deserializes the internal item.
        /// </summary>
        /// <param name="itemId">The item id.</param>
        /// <param name="inDeserializationContext">The in deserialization context.</param>
        /// <param name="reader">The reader.</param>
        /// <returns>InternalItem</returns>
        private static InternalItem DeserializeInternalItem(byte[] itemId, InDeserializationContext inDeserializationContext, IPrimitiveReader reader)
        {
            byte kvpListCount = reader.ReadByte();

            List <KeyValuePair <int, byte[]> > kvpList = null;

            if (kvpListCount > 0)
            {
                kvpList = new List <KeyValuePair <int, byte[]> >(kvpListCount);
                for (byte j = 0; j < kvpListCount; j++)
                {
                    int    tagHashCode = reader.ReadInt32();
                    ushort tagValueLen = reader.ReadUInt16();
                    byte[] tagValue    = null;
                    if (tagValueLen > 0)
                    {
                        tagValue = reader.ReadBytes(tagValueLen);
                        if (inDeserializationContext.StringHashCodeDictionary != null &&
                            inDeserializationContext.StringHashCodeDictionary.Count > 0 &&
                            inDeserializationContext.StringHashCodeDictionary.ContainsKey(tagHashCode))
                        {
                            tagValue =
                                inDeserializationContext.StringHashCollection.GetStringByteArray(
                                    inDeserializationContext.TypeId, tagValue);
                        }
                    }
                    kvpList.Add(new KeyValuePair <int, byte[]>(tagHashCode, tagValue));
                }
            }
            return(new InternalItem {
                ItemId = itemId, TagList = kvpList
            });
        }
Esempio n. 8
0
 public void Deserialize(IPrimitiveReader reader, int version)
 {
     using (reader.CreateRegion())
     {
         CommandType commandType = (CommandType)reader.ReadByte();
         command = CommandFactory.CreateCommand(reader, commandType);
     }
 }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //Offset
            offset = reader.ReadInt32();

            //ItemNum
            itemNum = reader.ReadInt32();

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }
            }

            if (version >= 3)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Deserializes the specified reader.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="version">The version.</param>
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FieldName
                FieldName = reader.ReadString();

                //IsTag
                IsTag = reader.ReadBoolean();

                //Operation
                Operation = (Operation)reader.ReadByte();

                //Value
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    Value = reader.ReadBytes(len);
                }

                //DataType
                DataType = (DataType)reader.ReadByte();

                if (version >= 2)
                {
                    //MatchValue
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        ExpectedBitwiseResult = reader.ReadBytes(len);
                    }

                    //ShiftBy
                    ShiftBy = reader.ReadByte();
                }

                if (version >= 3)
                {
                    //MetadataProperty
                    MetadataProperty = reader.ReadString();
                }
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Deserializes the internal item.
        /// </summary>
        /// <param name="internalItem">The internal item</param>
        /// <param name="inDeserializationContext">The in deserialization context.</param>
        /// <param name="outDeserializationContext">The out deserialization context.</param>
        /// <param name="reader">The reader.</param>
        private static void DeserializeTags(InternalItem internalItem,
                                            InDeserializationContext inDeserializationContext,
                                            OutDeserializationContext outDeserializationContext,
                                            IPrimitiveReader reader)
        {
            byte kvpListCount = reader.ReadByte();

            if (kvpListCount > 0)
            {
                internalItem.TagList = new List <KeyValuePair <int, byte[]> >(kvpListCount);
                for (byte j = 0; j < kvpListCount; j++)
                {
                    int    tagHashCode = reader.ReadInt32();
                    ushort tagValueLen = reader.ReadUInt16();
                    byte[] tagValue    = null;
                    if (tagValueLen > 0)
                    {
                        tagValue = reader.ReadBytes(tagValueLen);
                        if (inDeserializationContext.StringHashCodeDictionary != null &&
                            inDeserializationContext.StringHashCodeDictionary.Count > 0 &&
                            inDeserializationContext.StringHashCodeDictionary.ContainsKey(tagHashCode))
                        {
                            tagValue = inDeserializationContext.StringHashCollection.GetStringByteArray(inDeserializationContext.TypeId, tagValue);
                        }
                    }
                    internalItem.TagList.Add(new KeyValuePair <int, byte[]>(tagHashCode, tagValue));
                }
            }

            //Get Distinct Values
            if (!String.IsNullOrEmpty(inDeserializationContext.GetDistinctValuesFieldName))
            {
                byte[] distinctValue;
                if (String.Equals(inDeserializationContext.GetDistinctValuesFieldName, "ItemId", StringComparison.OrdinalIgnoreCase))
                {
                    distinctValue = internalItem.ItemId;
                }
                else
                {
                    internalItem.TryGetTagValue(inDeserializationContext.GetDistinctValuesFieldName, out distinctValue);
                }

                if (distinctValue != null)
                {
                    if (outDeserializationContext.DistinctValueCountMapping.ContainsKey(distinctValue))
                    {
                        outDeserializationContext.DistinctValueCountMapping[distinctValue] += 1;
                    }
                    else
                    {
                        outDeserializationContext.DistinctValueCountMapping.Add(distinctValue, 1);
                    }
                }
            }
        }
 public void Deserialize(IPrimitiveReader reader, int version)
 {
     using (reader.CreateRegion())
     {
         //Filter
         byte b = reader.ReadByte();
         if (b != 0)
         {
             FilterType filterType = (FilterType)b;
             filter = FilterFactory.CreateFilter(reader, filterType);
         }
     }
 }
        /// <summary>
        /// Reads the serialized header
        /// </summary>
        /// <param name="reader"></param>
        public void Read(IPrimitiveReader reader)
        {
            this.headerPosition = reader.BaseStream.Position;
            this.headerVersion  = reader.ReadByte();
            this.headerLength   = reader.ReadInt16();
            this.flags          = (TypeSerializationHeaderFlags)reader.ReadByte();
            this.dataVersion    = reader.ReadByte();
            this.dataMinVersion = reader.ReadByte();
            this.dataLength     = reader.ReadInt32();
            this.dataPosition   = this.headerPosition + this.headerLength;

            if (this.headerVersion > CurrentHeaderVersion)
            {
                throw new ApplicationException("This object was serialized with a newer version of the serialization framework");
            }
            if ((this.flags & ~TypeSerializationHeaderFlags.KnownFlags) != 0)
            {
                throw new ApplicationException("This object was serialized with features that are not supported in this version of the serialization framework");
            }

            reader.BaseStream.Seek(this.dataPosition, System.IO.SeekOrigin.Begin);
        }
 public void Deserialize(IPrimitiveReader reader, int version)
 {
     using (reader.CreateRegion())
     {
         //Filter
         byte b = reader.ReadByte();
         if (b != 0)
         {
             FilterType filterType = (FilterType)b;
             filter = FilterFactory.CreateFilter(reader, filterType);
         }
     }
 }
Esempio n. 15
0
        /// <summary>
        /// Reads a <see cref="TypeInfo"/> object from the specified reader.
        /// </summary>
        /// <param name="reader">The reader to read from.</param>
        /// <returns>
        ///	<para>The <see cref="TypeInfo"/> read from <paramref name="reader"/>.</para>
        /// </returns>
        /// <exception cref="InvalidDataException">
        ///	<para>Unexpected data is encountered in the stream.</para>
        /// </exception>
        public static TypeInfo ReadFrom(IPrimitiveReader reader)
        {
            var mode = (Mode)reader.ReadByte();

            switch (mode)
            {
            case Mode.Id:
                return(Get(reader.ReadInt16()));

            case Mode.Name:
                return(_typeInfoByTypeName(reader.ReadString()));
            }
            throw new InvalidDataException(string.Format("Unexpected mode encountered {0}", (byte)mode));
        }
Esempio n. 16
0
        internal static BarfStreamHeader ReadFrom(IPrimitiveReader reader)
        {
            var result = new BarfStreamHeader();
            var value  = reader.ReadVarInt32();

            if (value < 0)
            {
                reader.RaiseInvalidDataException();
            }
            result.FrameworkVersion = value;

            result.Flags = (HeaderFlags)reader.ReadByte();

            return(result);
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //MultiItemResult
            if (reader.ReadByte() != 0)
            {
                MultiItemResult = new MultiItemResult();
                MultiItemResult.Deserialize(reader);
            }

            //Metadata
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                Metadata = reader.ReadBytes(len);
            }

            //IndexSize
            IndexSize = reader.ReadInt32();

            //IndexExists
            IndexExists = reader.ReadBoolean();

            //ExceptionInfo
            ExceptionInfo = reader.ReadString();

            //VirtualCount
            if (version >= 2)
            {
                VirtualCount = reader.ReadInt32();
            }

            //IndexCap
            if (version >= 3)
            {
                IndexCap = reader.ReadInt32();
            }

            if (version >= 4)
            {
                //MetadataPropertyCollection
                if (reader.ReadBoolean())
                {
                    MetadataPropertyCollection = new MetadataPropertyCollection();
                    Serializer.Deserialize(reader.BaseStream, MetadataPropertyCollection);
                }
            }
        }
        /// <summary>
        /// Skips the deserialization of the internal item.
        /// </summary>
        /// <param name="reader">The reader.</param>
        private static void SkipDeserializeInternalItem(IPrimitiveReader reader)
        {
            var kvpListCount = reader.ReadByte();

            //kvpList
            if (kvpListCount > 0)
            {
                for (byte j = 0; j < kvpListCount; j++)
                {
                    //tagHashCode
                    reader.ReadBytes(4);

                    //tagValueLen + value
                    reader.ReadBytes(reader.ReadUInt16());
                }
            }
        }
Esempio n. 19
0
 public override void Deserialize(IPrimitiveReader reader, int version)
 {
     using (reader.CreateRegion())
     {
         FilterType filterType;
         ushort     count = reader.ReadUInt16();
         FilterList = new List <Filter>(count);
         Filter childFilter;
         for (ushort i = 0; i < count; i++)
         {
             filterType  = (FilterType)reader.ReadByte();
             childFilter = FilterFactory.CreateFilter(reader, filterType);
             FilterList.Add(childFilter);
             totalCount += childFilter.FilterCount;
         }
     }
 }
Esempio n. 20
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //Count
                byte count = reader.ReadByte();

                FullDataIdField fullDataIdField;
                for (int i = 0; i < count; i++)
                {
                    //FullDataIdField
                    fullDataIdField = new FullDataIdField();
                    Serializer.Deserialize(reader.BaseStream, fullDataIdField);
                    Add(fullDataIdField);
                }
            }
        }
Esempio n. 21
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //TypeExists
            TypeExists = reader.ReadBoolean();

            //TagNameList
            byte tagNamesLength = reader.ReadByte();

            if (tagNamesLength > 0)
            {
                TagNames = new string[tagNamesLength];
                for (int i = 0; i < tagNamesLength; i++)
                {
                    TagNames[i] = reader.ReadString();
                }
            }

            //ExceptionInfo
            ExceptionInfo = reader.ReadString();
        }
        /// <summary>
        /// Deserializes a BitArray from the reader.
        /// </summary>
        /// <param name="bitArray">The bit array</param>
        /// <param name="reader">The primitive writer</param>
        public static void DeserializeBitArray(out BitArray bitArray, IPrimitiveReader reader)
        {
            byte byteCount = reader.ReadByte();

            // Is the BitArray null?
            if (byteCount == byte.MaxValue)
            {
                bitArray = null;
                return;
            }

            // Does the BitArray contain any values?
            if (byteCount == 0)
            {
                bitArray = new BitArray(0, false);
                return;
            }

            // Instantiate the bit array
            bitArray = new BitArray(reader.ReadBytes(byteCount));
        }
        /// <summary>
        /// Deserializes a BitArray from the reader.
        /// </summary>
        /// <param name="bitArray">The bit array</param>
        /// <param name="reader">The primitive writer</param>
        public static void DeserializeBitArray(out BitArray bitArray, IPrimitiveReader reader)
        {
            byte byteCount = reader.ReadByte();

            // Is the BitArray null?
            if (byteCount == byte.MaxValue)
            {
                bitArray = null;
                return;
            }

            // Does the BitArray contain any values?
            if (byteCount == 0)
            {
                bitArray = new BitArray(0, false);
                return;
            }

            // Instantiate the bit array
            bitArray = new BitArray(reader.ReadBytes(byteCount));
        }
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    indexId = reader.ReadBytes(len);
                }

                //Count
                count = reader.ReadInt32();

                //TargetIndexName
                targetIndexName = reader.ReadString();

                //ExcludeData
                excludeData = reader.ReadBoolean();

                //GetMetadata
                getMetadata = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }

                if (version >= 2)
                {
                    //FullDataIdInfo
                    fullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
                }
            }
        }
Esempio n. 25
0
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    IndexId = reader.ReadBytes(len);
                }

                //TargetIndexName
                TargetIndexName = reader.ReadString();

                //DeleteFilter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    DeleteFilter = FilterFactory.CreateFilter(reader, filterType);
                }
            }
        }
Esempio n. 26
0
        /// <summary>
        /// Am even faster way to et known value type, using strongly typed accessor on platform supporting it.
        /// </summary>
        /// <param name="reader">The source of the value</param>
        /// <param name="instance">The instance which member would be set</param>
        /// <returns>Whether the value could be set. If not the <paramref name="reader"/> won't be read.</returns>
        public bool TryFastReadSet(IPrimitiveReader reader, object instance)
        {
#if __NET__ || __NETCORE__
            if (hasFastSetter && instance != null)
            {
                switch (Type.Kind)
                {
                case PrimitiveType.Guid:
                    setterGuid(instance, reader.ReadGuid());
                    break;

                case PrimitiveType.Bool:
                    setterBool(instance, reader.ReadBool());
                    break;

                case PrimitiveType.Char:
                    setterChar(instance, reader.ReadChar());
                    break;

                case PrimitiveType.Byte:
                    setterByte(instance, reader.ReadByte());
                    break;

                case PrimitiveType.SByte:
                    setterSByte(instance, reader.ReadSByte());
                    break;

                case PrimitiveType.Int16:
                    setterInt16(instance, reader.ReadInt16());
                    break;

                case PrimitiveType.UInt16:
                    setterUInt16(instance, reader.ReadUInt16());
                    break;

                case PrimitiveType.Int32:
                    setterInt32(instance, reader.ReadInt32());
                    break;

                case PrimitiveType.UInt32:
                    setterUInt32(instance, reader.ReadUInt32());
                    break;

                case PrimitiveType.Int64:
                    setterInt64(instance, reader.ReadInt64());
                    break;

                case PrimitiveType.UInt64:
                    setterUInt64(instance, reader.ReadUInt64());
                    break;

                case PrimitiveType.Single:
                    setterSingle(instance, reader.ReadSingle());
                    break;

                case PrimitiveType.Double:
                    setterDouble(instance, reader.ReadDouble());
                    break;

                case PrimitiveType.Decimal:
                    setterDecimal(instance, reader.ReadDecimal());
                    break;
                }
                return(true);
            }
#endif
            return(false);
        }
Esempio n. 27
0
        public virtual void Deserialize(IPrimitiveReader reader, int version)
        {
            //TargetIndexName
            targetIndexName = reader.ReadString();

            //IndexIdList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                indexIdList = new List <byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        indexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetIndexHeader
            getIndexHeader = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                primaryIdList = new List <int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    primaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();

            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                intersectionQueryParamsMapping = new Dictionary <byte[], IntersectionQueryParams>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                IntersectionQueryParams intersectionQueryParam;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len     = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        intersectionQueryParam = new IntersectionQueryParams();
                        Serializer.Deserialize(reader.BaseStream, intersectionQueryParam);

                        intersectionQueryParamsMapping.Add(indexId, intersectionQueryParam);
                    }
                }
            }

            if (version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
Esempio n. 28
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    indexId = reader.ReadBytes(len);
                }

                //Count
                count = reader.ReadInt32();

                //TargetIndexName
                targetIndexName = reader.ReadString();

                //ExcludeData
                excludeData = reader.ReadBoolean();

                //GetMetadata
                getMetadata = reader.ReadBoolean();

                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType) b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }

                if (version >= 2)
                {
                    //FullDataIdInfo
                    fullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
                }
            }
        }
Esempio n. 29
0
        internal object ReadImpl(ReadArgs args)
        {
            // check id first
            ulong oid = 0;
            if (args.TypeData.IsReference)
            {
                oid = input.ReadVUInt();
                if (TryGetObject(oid, out var result))
                    return result;
            }

            // if expected is not final
            if (args.TypeData.IsReference && !args.TypeData.IsSealed)
                args = new ReadArgs((TypeData)ReadImpl(AType), args.TypeHint, args.Instance);

            object ReturnRegister(object value)
            {
                if (oid != 0)
                    Register(oid, value);
                return value;
            }

            // only proceed further if type is supported
            if (!args.TypeData.IsSupported)
                return ReturnRegister(new ObjectData(args.TypeData));

            // dispatch to appropriate read method
            if (args.TypeData.Surrogate != null)
            {
                return ReturnRegister(ReadSurrogate(args));
            }
            else if (args.TypeData.HasConverter && !settings.IgnoreTypeConverter)
            {
                return ReturnRegister(ReadConverter(args));
            }
            else if (args.TypeData.IsISerializable && !settings.IgnoreISerializable)
            {
                return ReturnRegister(ReadISerializable(args));
            }
            else
            {
                switch (args.TypeData.Kind)
                {
                    default:
                    case PrimitiveType.None:
                        throw new InvalidOperationException("shouldn't be there");
                    case PrimitiveType.Object:
                        if (args.TypeData.IsArray)
                        {
                            return ReadArray(args, oid);
                        }
                        else if (args.TypeData.IsNullable)
                        {
                            object o = null;
                            var isNotNull = input.ReadBool();
                            if (isNotNull)
                                o = ReadImpl(new ReadArgs(args.TypeData.GenericParameters[0]));
                            return ReturnRegister(o);
                        }
                        else if (args.TypeData.IsEnum)
                        {
                            var val = ReadImpl(new ReadArgs(args.TypeData.Element));
                            var eType = args.InstanceType(readRaw);
                            if (eType != null)
                            {
                                val = Enum.ToObject(eType.Type, val);
                            }
                            else
                            {
                                // leave it as is?
                                // or return an ObjectData?
                            }
                            return ReturnRegister(val);
                        }
                        else
                        {
                            return ReturnRegister(ReadObject(args, oid));
                        }
                    case PrimitiveType.Type:
                        {
                            var result = new TypeData();
                            ReturnRegister(result);
                            result.Read(this, input);
                            return result;
                        }
                    case PrimitiveType.String:
                        return ReturnRegister(input.ReadString());
                    case PrimitiveType.Bytes:
                        return ReturnRegister(input.ReadBytes());
                    case PrimitiveType.Guid:
                        return ReturnRegister(input.ReadGuid());
                    case PrimitiveType.Bool:
                        return ReturnRegister(input.ReadBool());
                    case PrimitiveType.Char:
                        return ReturnRegister(input.ReadChar());
                    case PrimitiveType.Byte:
                        return ReturnRegister(input.ReadByte());
                    case PrimitiveType.SByte:
                        return ReturnRegister(input.ReadSByte());
                    case PrimitiveType.Int16:
                        return ReturnRegister(input.ReadInt16());
                    case PrimitiveType.UInt16:
                        return ReturnRegister(input.ReadUInt16());
                    case PrimitiveType.Int32:
                        return ReturnRegister(input.ReadInt32());
                    case PrimitiveType.UInt32:
                        return ReturnRegister(input.ReadUInt32());
                    case PrimitiveType.Int64:
                        return ReturnRegister(input.ReadInt64());
                    case PrimitiveType.UInt64:
                        return ReturnRegister(input.ReadUInt64());
                    case PrimitiveType.Single:
                        return ReturnRegister(input.ReadSingle());
                    case PrimitiveType.Double:
                        return ReturnRegister(input.ReadDouble());
                    case PrimitiveType.Decimal:
                        return ReturnRegister(input.ReadDecimal());
                }
            }
        }
        /// <summary>
        /// Skips the deserialization of the internal item.
        /// </summary>
        /// <param name="reader">The reader.</param>
        private static void SkipDeserializeInternalItem(IPrimitiveReader reader)
        {
            var kvpListCount = reader.ReadByte();

            //kvpList          
            if (kvpListCount > 0)
            {
                for (byte j = 0; j < kvpListCount; j++)
                {
                    //tagHashCode 
                    reader.ReadBytes(4);

                    //tagValueLen + value
                    reader.ReadBytes(reader.ReadUInt16());
                }
            }
        }
        public virtual void Deserialize(IPrimitiveReader reader, int version)
        {
            //TargetIndexName
            targetIndexName = reader.ReadString();

            //IndexIdList
            ushort count = reader.ReadUInt16();
            if (count > 0)
            {
                indexIdList = new List<byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        indexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetIndexHeader
            getIndexHeader = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                primaryIdList = new List<int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    primaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();
            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                intersectionQueryParamsMapping = new Dictionary<byte[], IntersectionQueryParams>(count, new ByteArrayEqualityComparer());
                byte[] indexId;
                IntersectionQueryParams intersectionQueryParam;
                ushort len;

                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        intersectionQueryParam = new IntersectionQueryParams();
                        Serializer.Deserialize(reader.BaseStream, intersectionQueryParam);

                        intersectionQueryParamsMapping.Add(indexId, intersectionQueryParam);
                    }
                }
            }

            if (version >= 2)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
Esempio n. 32
0
        //***************************************************************
        //
        //  Deserialize
        //
        /// <summary>
        /// Determines if the stream contains a name table and loads it if it exists
        /// </summary>
        /// <param name="reader"></param>
        public void Deserialize(IPrimitiveReader reader, TypeSerializationHeader header)
        {
            long   oldPosition   = reader.BaseStream.Position;
            long   endPosition   = 0;
            short  size          = 0;
            short  signature     = 0;
            byte   assemblyCount = 0;
            byte   typeCount     = 0;
            byte   index         = 0;
            string assemblyName  = null;

            string[] assemblyNames = null;
            string   typeName      = null;
            string   namespaceName = null;

            string[] namespaceNames = null;
            byte     namespaceCount = 0;

            //  Determine if the stream contains a name table
            if ((reader.BaseStream.Length - oldPosition) < HeaderLength)
            {
                return;
            }

            endPosition = reader.BaseStream.Seek(-HeaderLength, System.IO.SeekOrigin.End);
            size        = reader.ReadInt16();
            signature   = reader.ReadInt16();

            if (signature == Signature)
            {
                reader.BaseStream.Seek(endPosition - size, System.IO.SeekOrigin.Begin);

                //  Load assembly names
                assemblyCount = reader.ReadByte();
                assemblyNames = new string[assemblyCount];
                for (index = 0; index < assemblyCount; index++)
                {
                    assemblyNames[index] = reader.ReadString();
                }

                //  Load namespace names
                namespaceCount = reader.ReadByte();
                namespaceNames = new string[namespaceCount];
                for (index = 0; index < namespaceCount; index++)
                {
                    namespaceNames[index] = reader.ReadString();
                }

                //  Load types
                typeCount = reader.ReadByte();
                this.resolvedTypeTable = new TypeInfo[typeCount];
                for (index = 0; index < typeCount; index++)
                {
                    TypeInfo rti = new TypeInfo();

                    if ((header != null) && (header.HeaderVersion >= 1))
                    {
                        rti.Version = reader.ReadByte();
                    }

                    assemblyName  = assemblyNames[reader.ReadByte()];
                    namespaceName = namespaceNames[reader.ReadByte()];
                    typeName      = reader.ReadString();
                    rti.TypeName  = string.Format("{1}.{0},{2}", typeName, namespaceName, assemblyName);

                    this.resolvedTypeTable[index] = rti;
                }
            }

            //  Reset stream position
            reader.BaseStream.Seek(oldPosition, System.IO.SeekOrigin.Begin);
        }
 public override void Deserialize(IPrimitiveReader reader, int version)
 {
     using (reader.CreateRegion())
     {
         FilterType filterType;
         ushort count = reader.ReadUInt16();
         FilterList = new List<Filter>(count);
         Filter childFilter;
         for (ushort i = 0; i < count; i++)
         {
             filterType = (FilterType) reader.ReadByte();
             childFilter = FilterFactory.CreateFilter(reader, filterType);
             FilterList.Add(childFilter);
             totalCount += childFilter.FilterCount;
         }
     }
 }
		public void Deserialize(IPrimitiveReader reader, int version)
		{
            //MultiItemResult
            if (reader.ReadByte() != 0)
            {
                multiItemResult = new MultiItemResult();
                multiItemResult.Deserialize(reader);
            }

            //Metadata
            ushort len = reader.ReadUInt16();
            if (len > 0)
            {
                metadata = reader.ReadBytes(len);
            }

            //IndexSize
            indexSize = reader.ReadInt32();

            //IndexExists
            indexExists = reader.ReadBoolean();

            //ExceptionInfo
            exceptionInfo = reader.ReadString();

            //VirtualCount
            if(version >= 2)
            {
                virtualCount = reader.ReadInt32();
            }
        }
Esempio n. 35
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();
            if (len > 0)
            {
                indexId = reader.ReadBytes(len);
            }

            //FirstPageSize
            firstPageSize = reader.ReadInt32();

            //LastPageSize
            lastPageSize = reader.ReadInt32();

            //TargetIndexName
            targetIndexName = reader.ReadString();

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //ExcludeData
            excludeData = reader.ReadBoolean();

            //GetMetadata
            getMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    filter = FilterFactory.CreateFilter(reader, filterType);
                }
            }

            if(version >= 3)
            {
                //FullDataIdInfo
                fullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, fullDataIdInfo);
            }
        }
        /// <summary>
        /// Deserializes the internal item.
        /// </summary>
        /// <param name="itemId">The item id.</param>
        /// <param name="inDeserializationContext">The in deserialization context.</param>
        /// <param name="reader">The reader.</param>
        /// <returns>InternalItem</returns>
        private static InternalItem DeserializeInternalItem(byte[] itemId, InDeserializationContext inDeserializationContext, IPrimitiveReader reader)
        {
            byte kvpListCount = reader.ReadByte();

            List<KeyValuePair<int, byte[]>> kvpList = null;
            if (kvpListCount > 0)
            {
                kvpList = new List<KeyValuePair<int, byte[]>>(kvpListCount);
                for (byte j = 0; j < kvpListCount; j++)
                {
                    int tagHashCode = reader.ReadInt32();
                    ushort tagValueLen = reader.ReadUInt16();
                    byte[] tagValue = null;
                    if (tagValueLen > 0)
                    {
                        tagValue = reader.ReadBytes(tagValueLen);
                        if (inDeserializationContext.StringHashCodeDictionary != null &&
                            inDeserializationContext.StringHashCodeDictionary.Count > 0 &&
                            inDeserializationContext.StringHashCodeDictionary.ContainsKey(tagHashCode))
                        {
                            tagValue =
                                inDeserializationContext.StringHashCollection.GetStringByteArray(
                                    inDeserializationContext.TypeId, tagValue);
                        }
                    }
                    kvpList.Add(new KeyValuePair<int, byte[]>(tagHashCode, tagValue));
                }
            }
            return new InternalItem { ItemId = itemId, TagList = kvpList };
        }
Esempio n. 37
0
        /// <summary>
        /// Deserializes the specified reader.
        /// </summary>
        /// <param name="reader">The reader.</param>
        /// <param name="version">The version.</param>
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FieldName
                FieldName = reader.ReadString();

                //IsTag
                IsTag = reader.ReadBoolean();

                //Operation
                Operation = (Operation)reader.ReadByte();

                //Value
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    Value = reader.ReadBytes(len);
                }

                //DataType
                DataType = (DataType)reader.ReadByte();

                if (version >= 2)
                {
                    //MatchValue
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        ExpectedBitwiseResult = reader.ReadBytes(len);
                    }

                    //ShiftBy
                    ShiftBy = reader.ReadByte();
                }
            }
        }
 /// <summary>
 /// Reads the serialized header
 /// </summary>
 /// <param name="reader"></param>
 public void Read(IPrimitiveReader reader)
 {
     this.headerPosition = reader.BaseStream.Position;
     this.headerVersion = reader.ReadByte();
     this.headerLength = reader.ReadInt16();
     this.flags = (TypeSerializationHeaderFlags)reader.ReadByte();
     this.dataVersion = reader.ReadByte();
     this.dataMinVersion = reader.ReadByte();
     this.dataLength = reader.ReadInt32();
     this.dataPosition = this.headerPosition + this.headerLength;
     
     if (this.headerVersion > CurrentHeaderVersion)
     {
         throw new ApplicationException("This object was serialized with a newer version of the serialization framework");
     }
     if ((this.flags & ~TypeSerializationHeaderFlags.KnownFlags) != 0)
     {
         throw new ApplicationException("This object was serialized with features that are not supported in this version of the serialization framework");
     }
     
     reader.BaseStream.Seek(this.dataPosition, System.IO.SeekOrigin.Begin);
 }
Esempio n. 39
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                IndexId = reader.ReadBytes(len);
            }

            //Offset
            Offset = reader.ReadInt32();

            //ItemNum
            ItemNum = reader.ReadInt32();

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetMetadata
            GetMetadata = reader.ReadBoolean();

            if (version >= 2)
            {
                //Filter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    Filter = FilterFactory.CreateFilter(reader, filterType);
                }
            }

            if (version == 3)
            {
                //FullDataIdInfo
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            if (version >= 4)
            {
                //FullDataIdInfo
                if (reader.ReadBoolean())
                {
                    FullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
                }

                //TagSort
                if (reader.ReadBoolean())
                {
                    TagSort = new TagSort();
                    Serializer.Deserialize(reader.BaseStream, TagSort);
                }
            }

            if (version >= 5)
            {
                //IndexCondition
                if (reader.ReadBoolean())
                {
                    IndexCondition = new IndexCondition();
                    Serializer.Deserialize(reader.BaseStream, IndexCondition);
                }
            }

            if (version >= 6)
            {
                //DomainSpecificProcessingType
                DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
            }
        }
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //IndexId
                ushort len = reader.ReadUInt16();
                if (len > 0)
                {
                    indexId = reader.ReadBytes(len);
                }

                //TargetIndexName
                targetIndexName = reader.ReadString();

                //DeleteFilter
                byte b = reader.ReadByte();
                if (b != 0)
                {
                    FilterType filterType = (FilterType)b;
                    deleteFilter = FilterFactory.CreateFilter(reader, filterType);
                }
            }
        }
Esempio n. 41
0
        public override void Deserialize(IPrimitiveReader reader, int version)
        {
            //Offset
            Offset = reader.ReadInt32();

            //Span
            Span = reader.ReadInt32();

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //TagsFromIndexes
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                TagsFromIndexes = new List <string>(count);
                for (ushort i = 0; i < count; i++)
                {
                    TagsFromIndexes.Add(reader.ReadString());
                }
            }

            //TagSort
            if (reader.ReadByte() != 0)
            {
                TagSort = new TagSort();
                Serializer.Deserialize(reader.BaseStream, TagSort);
            }

            //IndexIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexIdList = new List <byte[]>(count);
                ushort len;
                for (ushort i = 0; i < count; i++)
                {
                    len = reader.ReadUInt16();
                    if (len > 0)
                    {
                        IndexIdList.Add(reader.ReadBytes(len));
                    }
                }
            }

            //Read a byte to account for deprecated CriterionList
            reader.ReadByte();

            //MaxItemsPerIndex
            MaxItems = reader.ReadInt32();

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetIndexHeader
            GetIndexHeader = reader.ReadBoolean();

            //GetPageableItemCount
            GetAdditionalAvailableItemCount = reader.ReadBoolean();

            //PrimaryIdList
            count = reader.ReadUInt16();
            if (count > 0)
            {
                PrimaryIdList = new List <int>(count);
                for (ushort i = 0; i < count; i++)
                {
                    PrimaryIdList.Add(reader.ReadInt32());
                }
            }

            //Filter
            byte b = reader.ReadByte();

            if (b != 0)
            {
                FilterType filterType = (FilterType)b;
                Filter = FilterFactory.CreateFilter(reader, filterType);
            }

            //IndexIdParamsMapping
            count = reader.ReadUInt16();
            if (count > 0)
            {
                IndexIdParamsMapping = new Dictionary <byte[], IndexIdParams>(count, new ByteArrayEqualityComparer());
                byte[]        indexId;
                IndexIdParams indexIdParam;
                ushort        len;

                for (ushort i = 0; i < count; i++)
                {
                    len     = reader.ReadUInt16();
                    indexId = null;
                    if (len > 0)
                    {
                        indexId = reader.ReadBytes(len);

                        indexIdParam = new IndexIdParams();
                        Serializer.Deserialize(reader.BaseStream, indexIdParam);

                        IndexIdParamsMapping.Add(indexId, indexIdParam);
                    }
                }
            }

            //FullDataIdInfo
            if (reader.ReadBoolean())
            {
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            //ClientSideSubsetProcessingRequired
            ClientSideSubsetProcessingRequired = reader.ReadBoolean();

            if (version >= 2)
            {
                //CapCondition
                if (reader.ReadBoolean())
                {
                    CapCondition = new CapCondition();
                    Serializer.Deserialize(reader.BaseStream, CapCondition);
                }
            }

            if (version >= 3)
            {
                //GetIndexHeaderType
                GetIndexHeaderType = (GetIndexHeaderType)reader.ReadByte();
            }
        }
        /// <summary>
        /// Deserialize the class data from a stream.
        /// </summary>
        /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param>
        /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream;
        /// the version of the <paramref name="reader"/> data.</param>
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            using (reader.CreateRegion())
            {
                //FullDataIdType
                FullDataIdType = (FullDataIdType)reader.ReadByte();

                //TagName
                TagName = reader.ReadString();

                if (version >= 2)
                {
                    //Offset
                    reader.ReadInt32();

                    //Count
                    reader.ReadInt32();

                    //DataType
                    DataType = (DataType)reader.ReadByte();

                    //FullDataIdFieldList
                    if (reader.ReadBoolean())
                    {
                        FullDataIdFieldList = new FullDataIdFieldList();
                        Serializer.Deserialize(reader.BaseStream, FullDataIdFieldList);
                    }

                    //FullDataIdPartFormat
                    FullDataIdPartFormat = (FullDataIdPartFormat)reader.ReadByte();
                }
            }
        }
 public void Deserialize(IPrimitiveReader reader, int version)
 {
     using (reader.CreateRegion())
     {
         CommandType commandType = (CommandType)reader.ReadByte();
         command = CommandFactory.CreateCommand(reader, commandType);
     }
 }
Esempio n. 44
0
        public void Deserialize(IPrimitiveReader reader, int version)
        {
            //IndexId
            ushort len = reader.ReadUInt16();

            if (len > 0)
            {
                IndexId = reader.ReadBytes(len);
            }

            //IndexItemList
            ushort count = reader.ReadUInt16();

            if (count > 0)
            {
                IndexItem indexItem;
                IndexItemList = new List <IndexItem>(count);
                for (ushort i = 0; i < count; i++)
                {
                    indexItem = new IndexItem();
                    indexItem.Deserialize(reader);
                    IndexItemList.Add(indexItem);
                }
            }

            //TargetIndexName
            TargetIndexName = reader.ReadString();

            //TagsFromIndexes
            count           = reader.ReadUInt16();
            TagsFromIndexes = new List <string>(count);
            if (count > 0)
            {
                for (ushort i = 0; i < count; i++)
                {
                    TagsFromIndexes.Add(reader.ReadString());
                }
            }

            //ExcludeData
            ExcludeData = reader.ReadBoolean();

            //GetMetadata
            GetMetadata = reader.ReadBoolean();

            if (version == 2)
            {
                //FullDataIdInfo
                FullDataIdInfo = new FullDataIdInfo();
                Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
            }

            if (version >= 3)
            {
                //FullDataIdInfo
                if (reader.ReadBoolean())
                {
                    FullDataIdInfo = new FullDataIdInfo();
                    Serializer.Deserialize(reader.BaseStream, FullDataIdInfo);
                }

                //DomainSpecificProcessingType
                DomainSpecificProcessingType = (DomainSpecificProcessingType)reader.ReadByte();
            }
        }