Exemple #1
0
            public override object unpack(ITransport transport)
            {
                int         length = (int)Int32.unpack(transport);
                HashSet <T> obj    = new HashSet <T> ();

                for (int i = 0; i < length; i++)
                {
                    obj.Add((T)(type.unpack(transport)));
                }
                return(obj);
            }
Exemple #2
0
            public override object unpack(ITransport transport)
            {
                int      length = (int)Int32.unpack(transport);
                List <T> lst    = new List <T> (length);

                for (int i = 0; i < length; i++)
                {
                    lst.Add((T)(type.unpack(transport)));
                }
                return(lst);
            }
Exemple #3
0
            public override object unpack(ITransport transport)
            {
                int length            = (int)Int32.unpack(transport);
                Dictionary <K, V> map = new Dictionary <K, V>(length);

                for (int i = 0; i < length; i++)
                {
                    K k = (K)(keytype.unpack(transport));
                    V v = (V)(valtype.unpack(transport));
                    map.Add(k, v);
                }
                return(map);
            }
Exemple #4
0
            public override Object unpack(ITransport transport)
            {
                int       length = (int)Int32.unpack(transport);
                HeteroMap map    = new HeteroMap(length);

                for (int i = 0; i < length; i++)
                {
                    int            keypid    = (int)Int32.unpack(transport);
                    AbstractPacker keypacker = getPacker(keypid);
                    Object         key       = keypacker.unpack(transport);

                    int            valpid    = (int)Int32.unpack(transport);
                    AbstractPacker valpacker = getPacker(valpid);
                    Object         val       = valpacker.unpack(transport);

                    map.Add(key, keypacker, val, valpacker);
                }
                return(map);
            }