Beispiel #1
0
        IMySqlValue IMySqlValue.ReadValue(MySqlPacket packet, long length, bool nullVal)
        {
            if (nullVal)
            {
                return new MySqlByte(true)
                       {
                           TreatAsBoolean = TreatAsBoolean
                       }
            }
            ;

            MySqlByte b;

            if (length == -1)
            {
                b = new MySqlByte((sbyte)packet.ReadByte());
            }
            else
            {
                string s = packet.ReadString(length);
                b = new MySqlByte(SByte.Parse(s, NumberStyles.Any, CultureInfo.InvariantCulture));
            }

            b.TreatAsBoolean = TreatAsBoolean;
            return(b);
        }

        void IMySqlValue.SkipValue(MySqlPacket packet)
        {
            packet.ReadByte();
        }
Beispiel #2
0
        IMySqlValue IMySqlValue.ReadValue(MySqlPacket packet, long length, bool nullVal)
        {
            if (nullVal)
            {
                return(new MySqlByte(true));
            }

            if (length == -1)
            {
                return(new MySqlByte((sbyte)packet.ReadByte()));
            }

            string    s = packet.ReadString(length);
            MySqlByte b = new MySqlByte(SByte.Parse(s, NumberStyles.Any, CultureInfo.InvariantCulture));

            b.TreatAsBoolean = TreatAsBoolean;
            return(b);
        }
        IMySqlValue IMySqlValue.ReadValue(MySqlPacket packet, long length, bool nullVal)
        {
            if (nullVal)
                return new MySqlByte(true);

            if (length == -1)
                return new MySqlByte((sbyte)packet.ReadByte());
            else
            {
                string s = packet.ReadString(length);
                MySqlByte b = new MySqlByte(SByte.Parse(s, NumberStyles.Any, CultureInfo.InvariantCulture));
                b.TreatAsBoolean = TreatAsBoolean;
                return b;
            }
        }