ReadListEnd() public abstract method

Read the end byte
public abstract ReadListEnd ( ) : void
return void
        /// <summary>
        /// Reads the array.
        /// </summary>
        /// <param name="abstractHessianInput">HessianInput</param>
        /// <param name="intLength">Length of data</param>
        /// <returns>Array data</returns>
        public override Object ReadList(AbstractHessianInput abstractHessianInput, int intLength)
        {
            if (intLength >= 0)
            {
                // mw bugfix
                //Object[] arrResult = createArray(intLength);
                Array arrResult = createArray(intLength);

                abstractHessianInput.AddRef(arrResult);

                if (m_componentType != null)
                {
                    for (int i = 0; i < arrResult.Length; i++)
                    {
                        arrResult.SetValue(abstractHessianInput.ReadObject(m_componentType), i);
                    }
                }
                else
                {
                    for (int i = 0; i < arrResult.Length; i++)
                    {
                        arrResult.SetValue(abstractHessianInput.ReadObject(), i);
                    }
                }

                abstractHessianInput.ReadListEnd();
                return(arrResult);
            }
            else
            {
                List <Object> colList = new List <Object>();
                abstractHessianInput.AddRef(colList);
                if (m_componentType != null)
                {
                    while (!abstractHessianInput.IsEnd())
                    {
                        colList.Add(abstractHessianInput.ReadObject(m_componentType));
                    }
                }
                else
                {
                    while (!abstractHessianInput.IsEnd())
                    {
                        colList.Add(abstractHessianInput.ReadObject());
                    }
                }

                abstractHessianInput.ReadListEnd();

                //Object[] arrResult = createArray(colList.Count);
                Array arrResult = createArray(colList.Count);
                for (int i = 0; i < colList.Count; i++)
                {
                    arrResult.SetValue(colList[i], i);
                }
                return(arrResult);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Reads the array.
        /// </summary>
        /// <param name="abstractHessianInput">HessianInput</param>
        /// <param name="intLength">Length of data</param>
        /// <returns>Array data</returns>
        public override Object ReadList(AbstractHessianInput abstractHessianInput, int intLength)
        {
            if (intLength >= 0)
            {
                // mw bugfix
                //Object[] arrResult = createArray(intLength);
                Array arrResult = createArray(intLength);

                abstractHessianInput.AddRef(arrResult);

                if (m_componentType != null)
                {
                    for (int i = 0; i < arrResult.Length; i++)
                        arrResult.SetValue(abstractHessianInput.ReadObject(m_componentType), i);
                }
                else
                {
                    for (int i = 0; i < arrResult.Length; i++)
                        arrResult.SetValue(abstractHessianInput.ReadObject(), i);
                }

                abstractHessianInput.ReadListEnd();
                return arrResult;
            }
            else
            {
                ArrayList colList = new ArrayList();
                abstractHessianInput.AddRef(colList);
                if (m_componentType != null)
                {
                    while (!abstractHessianInput.IsEnd())
                        colList.Add(abstractHessianInput.ReadObject(m_componentType));
                }
                else
                {
                    while (!abstractHessianInput.IsEnd())
                        colList.Add(abstractHessianInput.ReadObject());
                }

                abstractHessianInput.ReadListEnd();

                //Object[] arrResult = createArray(colList.Count);
                Array arrResult = createArray(colList.Count);
                for (int i = 0; i < colList.Count; i++)
                    arrResult.SetValue(colList[i], i);
                return arrResult;
            }
        }