Esempio n. 1
0
    /// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        base.toReadBytesFull(stream);

        stream.startReadObj();

        this.subsectionIndex = stream.readInt();

        this.subsectionSubIndex = stream.readInt();

        this.page = stream.readInt();

        this.arg = stream.readInt();

        if (stream.readBoolean())
        {
            int listLen = stream.readLen();
            if (this.list != null)
            {
                this.list.clear();
                this.list.ensureCapacity(listLen);
            }
            else
            {
                this.list = new SList <KeyData>();
            }

            SList <KeyData> listT = this.list;
            for (int listI = listLen - 1; listI >= 0; --listI)
            {
                KeyData listV;
                if (stream.readBoolean())
                {
                    BaseData listVT = stream.readDataFullNotNull();
                    if (listVT != null)
                    {
                        if (listVT is KeyData)
                        {
                            listV = (KeyData)listVT;
                        }
                        else
                        {
                            listV = new KeyData();
                            if (!(listVT.GetType().IsAssignableFrom(typeof(KeyData))))
                            {
                                stream.throwTypeReadError(typeof(KeyData), listVT.GetType());
                            }
                            listV.shadowCopy(listVT);
                        }
                    }
                    else
                    {
                        listV = null;
                    }
                }
                else
                {
                    listV = null;
                }

                listT.add(listV);
            }
        }
        else
        {
            this.list = null;
        }

        stream.endReadObj();
    }
    /// <summary>
    /// 读取字节流(完整版)
    /// </summary>
    protected override void toReadBytesFull(BytesReadStream stream)
    {
        base.toReadBytesFull(stream);

        stream.startReadObj();

        this.page = stream.readInt();

        this.arg = stream.readInt();

        if (stream.readBoolean())
        {
            int dicLen = stream.readLen();
            if (this.dic != null)
            {
                this.dic.clear();
                this.dic.ensureCapacity(dicLen);
            }
            else
            {
                this.dic = new IntObjectMap <KeyData>(dicLen);
            }

            IntObjectMap <KeyData> dicT = this.dic;
            for (int dicI = dicLen - 1; dicI >= 0; --dicI)
            {
                int     dicK;
                KeyData dicV;
                dicK = stream.readInt();

                if (stream.readBoolean())
                {
                    BaseData dicVT = stream.readDataFullNotNull();
                    if (dicVT != null)
                    {
                        if (dicVT is KeyData)
                        {
                            dicV = (KeyData)dicVT;
                        }
                        else
                        {
                            dicV = new KeyData();
                            if (!(dicVT.GetType().IsAssignableFrom(typeof(KeyData))))
                            {
                                stream.throwTypeReadError(typeof(KeyData), dicVT.GetType());
                            }
                            dicV.shadowCopy(dicVT);
                        }
                    }
                    else
                    {
                        dicV = null;
                    }
                }
                else
                {
                    dicV = null;
                }

                dicT.put(dicK, dicV);
            }
        }
        else
        {
            this.dic = null;
        }

        if (stream.readBoolean())
        {
            int changePageSetLen = stream.readLen();
            if (this.changePageSet != null)
            {
                this.changePageSet.clear();
                this.changePageSet.ensureCapacity(changePageSetLen);
            }
            else
            {
                this.changePageSet = new IntSet();
            }

            IntSet changePageSetT = this.changePageSet;
            for (int changePageSetI = changePageSetLen - 1; changePageSetI >= 0; --changePageSetI)
            {
                int changePageSetV;
                changePageSetV = stream.readInt();

                changePageSetT.add(changePageSetV);
            }
        }
        else
        {
            this.changePageSet = null;
        }

        stream.endReadObj();
    }