System.Xml.XmlNodeReader.ReadInt16()

The ReadInt16 method in the System.Xml.XmlNodeReader class reads a 16-bit signed integer from the XML stream.

Syntax:

public static short ReadInt16(XmlReader reader, out int size)
        

Parameters:

Returns:

The integer value read from the XML stream.

Example:


        XmlReader reader = XmlReader.Create(new StringReader("<item>1000</item>"));
        short value = (short)reader.ReadInt16();
        Console.WriteLine(value); // Output: 1000
        

Related Classes: