Opc.Ua.JsonDecoder.ReadInt16 C# (CSharp) Method

ReadInt16() public method

Reads a short from the stream.
public ReadInt16 ( string fieldName ) : short
fieldName string
return short
        public short ReadInt16(string fieldName)
        {
            object token = null;

            if (!ReadField(fieldName, out token))
            {
                return 0;
            }

            var value = token as long?;

            if (value == null)
            {
                return 0;
            }
;
            if (value < Int16.MinValue || value > Int16.MaxValue)
            {
                return 0;
            }

            return (short)value;
        }