public static double ReadDouble(NetworkBinaryReader reader) { object value = ReadNonnullObject("double", reader); if (value is double || value is float) { return((double)value); } if (value is string) { return(PrimitiveParser.ParseDouble((string)value)); } throw PrimitiveParser.CreateProtocolViolationException("double", value); }
public static double ReadDouble(NetworkBinaryReader reader) { object value = ReadNonnullObject("double", reader); if (value is double || value is float) { return((double)value); } if (value is string) { return(PrimitiveParser.ParseDouble((string)value)); } PrimitiveParser.InvalidConversion("double", value); return(0); }