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