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

        stream.startReadObj();

        this.version = stream.readInt();

        int listLen = stream.readLen();

        if (this.list != null)
        {
            this.list.clear();
            this.list.ensureCapacity(listLen);
        }
        else
        {
            this.list = new SList <RankData>();
        }

        SList <RankData> listT = this.list;

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

            listT.add(listV);
        }

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

        stream.startReadObj();

        this.version = stream.readInt();

        int listListMapLen = stream.readLen();

        if (this.listListMap != null)
        {
            this.listListMap.clear();
            this.listListMap.ensureCapacity(listListMapLen);
        }
        else
        {
            this.listListMap = new IntObjectMap <SList <SList <RankData> > >(listListMapLen);
        }

        IntObjectMap <SList <SList <RankData> > > listListMapT = this.listListMap;

        for (int listListMapI = listListMapLen - 1; listListMapI >= 0; --listListMapI)
        {
            int listListMapK;
            SList <SList <RankData> > listListMapV;
            listListMapK = stream.readInt();

            int listListMapVLen = stream.readLen();
            listListMapV = new SList <SList <RankData> >();
            SList <SList <RankData> > listListMapVT = listListMapV;
            for (int listListMapVI = listListMapVLen - 1; listListMapVI >= 0; --listListMapVI)
            {
                SList <RankData> listListMapVV;
                int listListMapVVLen = stream.readLen();
                listListMapVV = new SList <RankData>();
                SList <RankData> listListMapVVT = listListMapVV;
                for (int listListMapVVI = listListMapVVLen - 1; listListMapVVI >= 0; --listListMapVVI)
                {
                    RankData listListMapVVV;
                    BaseData listListMapVVVT = stream.readDataFullNotNull();
                    if (listListMapVVVT != null)
                    {
                        if (listListMapVVVT is RankData)
                        {
                            listListMapVVV = (RankData)listListMapVVVT;
                        }
                        else
                        {
                            listListMapVVV = new RankData();
                            if (!(listListMapVVVT.GetType().IsAssignableFrom(typeof(RankData))))
                            {
                                stream.throwTypeReadError(typeof(RankData), listListMapVVVT.GetType());
                            }
                            listListMapVVV.shadowCopy(listListMapVVVT);
                        }
                    }
                    else
                    {
                        listListMapVVV = null;
                    }

                    listListMapVVT.add(listListMapVVV);
                }

                listListMapVT.add(listListMapVV);
            }

            listListMapT.put(listListMapK, listListMapV);
        }

        stream.endReadObj();
    }