示例#1
0
        static Dictionary <string, byte[]> ToDict(RedisReader reader)
        {
            reader.ExpectType(RedisMessage.MultiBulk);
            long   count = reader.ReadInt(false);
            var    dict  = new Dictionary <string, byte[]>();
            string key   = String.Empty;

            for (int i = 0; i < count; i++)
            {
                if (i % 2 == 0)
                {
                    key = reader.ReadBulkString();
                }
                else
                {
                    dict[key] = reader.ReadBulkBytes();
                }
            }
            return(dict);
        }
示例#2
0
 public override byte[] Parse(RedisReader reader)
 {
     return(reader.ReadBulkBytes(true));
 }