Пример #1
0
        public static StructureField Decode(Stream inputStream)
        {
            if (inputStream == null || !inputStream.CanRead)
            {
                return(null);
            }
            StructureField instance = new StructureField();

            instance.Name        = String.Decode(inputStream);
            instance.Description = LocalizedText.Decode(inputStream);
            instance.DataType    = NodeID.Decode(inputStream);
            int?readInt32 = BaseType.ReadInt32(inputStream);

            if (readInt32 != null)
            {
                instance.ValueRank = readInt32.Value;
            }
            instance.ArrayDimension = SimpleArray <uint> .Decode(inputStream, BaseType.ReadUInt32);

            uint?readUInt32 = BaseType.ReadUInt32(inputStream);

            if (readUInt32 != null)
            {
                instance.MaxStringLength = readUInt32.Value;
            }
            instance.IsOptional = inputStream.ReadByte() != 0;
            return(instance);
        }