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:
reader: The XmlReader object to read from.size: The size of the integer value that was read.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: