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

ReadFloatArray() public method

Reads a float array from the stream.
public ReadFloatArray ( string fieldName ) : FloatCollection
fieldName string
return FloatCollection
        public FloatCollection ReadFloatArray(string fieldName)
        {
            bool isNil = false;

            FloatCollection values = new FloatCollection();
                                    
            if (BeginField(fieldName, true, out isNil))
            {                                
                PushNamespace(Namespaces.OpcUaXsd);
                
                while (MoveToElement("Float"))
                {
                    values.Add(ReadFloat("Float"));
                }

                // 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;
        }