상속: SerializableBase
예제 #1
0
        /// <summary>
        /// Deserialize from a stream.
        /// </summary>
        /// <param name="stream">A stream contains serialize.</param>
        /// <param name="size">Must be -1.</param>
        /// <returns>The number of bytes read from the stream.</returns>
        public override int Deserialize(Stream stream, int size)
        {
            int usedBytes = 0;

            AdapterHelper.Site.Assert.AreEqual(-1, size, "The size value MUST be -1, the actual value is {0}.", size);

            this.idsetList             = new List <REPLID_IDSETElement>();
            this.IsAllGLOBCNTInGLOBSET = true;
            this.IsAllGLOBCNTRanged    = true;
            this.IsDisjointGLOBCNTMadeIntoSingleton = true;
            this.HasAllDuplicateGLOBCNTRemoved      = true;
            this.HasGLOBCNTGroupedIntoRanges        = true;
            while (stream.Position < stream.Length)
            {
                REPLID_IDSETElement ele = new REPLID_IDSETElement();
                usedBytes += ele.Deserialize(stream, -1);
                this.IsAllGLOBCNTInGLOBSET = IsAllGLOBCNTInGLOBSET &&
                                             ele.GLOBSET.IsAllGLOBCNTInGLOBSET;
                this.IsAllGLOBCNTRanged = IsAllGLOBCNTRanged &&
                                          ele.GLOBSET.IsAllGLOBCNTRanged;
                this.IsDisjointGLOBCNTMadeIntoSingleton = IsDisjointGLOBCNTMadeIntoSingleton &&
                                                          ele.GLOBSET.IsDisjointGLOBCNTMadeIntoSingleton;
                this.HasAllDuplicateGLOBCNTRemoved = HasAllDuplicateGLOBCNTRemoved &&
                                                     ele.GLOBSET.HasAllDuplicateGLOBCNTRemoved;
                this.HasGLOBCNTGroupedIntoRanges = HasGLOBCNTGroupedIntoRanges &&
                                                   ele.GLOBSET.HasGLOBCNTGroupedIntoRanges;
                this.idsetList.Add(ele);
            }

            return(usedBytes);
        }
예제 #2
0
        /// <summary>
        /// Deserialize from a stream.
        /// </summary>
        /// <param name="stream">A stream contains serialize.</param>
        /// <param name="size">Must be -1.</param>
        /// <returns>The number of bytes read from the stream.</returns>
        public override int Deserialize(Stream stream, int size)
        {
            int usedBytes = 0;
            AdapterHelper.Site.Assert.AreEqual(-1, size, "The size value MUST be -1, the actual value is {0}.", size);

            this.idsetList = new List<REPLID_IDSETElement>();
            this.IsAllGLOBCNTInGLOBSET = true;
            this.IsAllGLOBCNTRanged = true;
            this.IsDisjointGLOBCNTMadeIntoSingleton = true;
            this.HasAllDuplicateGLOBCNTRemoved = true;
            this.HasGLOBCNTGroupedIntoRanges = true;
            while (stream.Position < stream.Length)
            {
                REPLID_IDSETElement ele = new REPLID_IDSETElement();
                usedBytes += ele.Deserialize(stream, -1);
                this.IsAllGLOBCNTInGLOBSET = IsAllGLOBCNTInGLOBSET
                    && ele.GLOBSET.IsAllGLOBCNTInGLOBSET;
                this.IsAllGLOBCNTRanged = IsAllGLOBCNTRanged
                    && ele.GLOBSET.IsAllGLOBCNTRanged;
                this.IsDisjointGLOBCNTMadeIntoSingleton = IsDisjointGLOBCNTMadeIntoSingleton
                    && ele.GLOBSET.IsDisjointGLOBCNTMadeIntoSingleton;
                this.HasAllDuplicateGLOBCNTRemoved = HasAllDuplicateGLOBCNTRemoved
                    && ele.GLOBSET.HasAllDuplicateGLOBCNTRemoved;
                this.HasGLOBCNTGroupedIntoRanges = HasGLOBCNTGroupedIntoRanges
                    && ele.GLOBSET.HasGLOBCNTGroupedIntoRanges;
                this.idsetList.Add(ele);
            }

            return usedBytes;
        }