public static short ReadInt16(NetworkBinaryReader reader) { object value = ReadNonnullObject("short", reader); if (value is short || value is byte) { return((short)value); } if (value is string) { return(PrimitiveParser.ParseShort((string)value)); } throw PrimitiveParser.CreateProtocolViolationException("short", value); }
public static short ReadInt16(NetworkBinaryReader reader) { object value = ReadNonnullObject("short", reader); if (value is short || value is byte) { return((short)value); } if (value is string) { return(PrimitiveParser.ParseShort((string)value)); } PrimitiveParser.InvalidConversion("short", value); return(0); }