Inheritance: IBEncodeValue
Ejemplo n.º 1
0
        internal static IBEncodeValue Parse(Stream d, byte firstByte)
        {
            IBEncodeValue v;
            char          first = (char)firstByte;

            //
            if (first == 'd')
            {
                v = new ValueDictionary();
            }
            else if (first == 'l')
            {
                v = new ValueList();
            }
            else if (first == 'i')
            {
                v = new ValueNumber();
            }
            else
            {
                v = new ValueString();
            }
            if (v is ValueString)
            {
                ((ValueString)v).Parse(d, (byte)first);
            }
            else
            {
                v.Parse(d);
            }
            return(v);
        }
Ejemplo n.º 2
0
        public static BEncodeValue Parse(Stream d, byte firstByte)
        {
            BEncodeValue value2;
            char         ch = (char)firstByte;

            switch (ch)
            {
            case 'd':
                value2 = new ValueDictionary();
                break;

            case 'l':
                value2 = new ValueList();
                break;

            case 'i':
                value2 = new ValueNumber();
                break;

            default:
                value2 = new ValueString();
                break;
            }
            if (value2 is ValueString)
            {
                ((ValueString)value2).Parse(d, (byte)ch);
                return(value2);
            }
            value2.Parse(d);
            return(value2);
        }
Ejemplo n.º 3
0
 internal static IBEncodeValue Parse(Stream d, byte firstByte)
 {
     IBEncodeValue v;
     char first = (char)firstByte;
     // 
     if (first == 'd') v = new ValueDictionary();
     else if (first == 'l') v = new ValueList();
     else if (first == 'i') v = new ValueNumber();
     else v = new ValueString();
     if (v is ValueString) ((ValueString)v).Parse(d, (byte)first);
     else v.Parse(d);
     return v;
 }