Opc.Ua.XmlDecoder.ReadInt32Array C# (CSharp) Method

ReadInt32Array() public method

Reads a int array from the stream.
public ReadInt32Array ( string fieldName ) : Int32Collection
fieldName string
return Int32Collection
        public Int32Collection ReadInt32Array(string fieldName)
        {
            bool isNil = false;

            Int32Collection values = new Int32Collection();
                                    
            if (BeginField(fieldName, true, out isNil))
            {                                
                PushNamespace(Namespaces.OpcUaXsd);
                
                while (MoveToElement("Int32"))
                {
                    values.Add(ReadInt32("Int32"));
                }

                // check the length.
                if (m_context.MaxArrayLength > 0 && m_context.MaxArrayLength < values.Count)
                {
                    throw new ServiceResultException(StatusCodes.BadEncodingLimitsExceeded);
                }

                PopNamespace();

                EndField(fieldName);
                return values;
            }

            if (isNil)
            {
                return null;
            }

            return values;
        }