internal override DateTime Parse(RedisExecutor executor) { executor.AssertType(RedisReplyType.MultiBulk); executor.AssertSize(2); int timestamp = Int32.Parse(executor.ReadBulkString()); int microseconds = Int32.Parse(executor.ReadBulkString()); return(FromTimestamp(timestamp, microseconds)); }
internal override T Parse(RedisExecutor executor) { if (this._checkType) { executor.AssertType(RedisReplyType.MultiBulk); executor.AssertSize(2); } T item = (T)Activator.CreateInstance(typeof(T), true); item.Parse(executor); return(item); }
internal override BinaryValue Parse(RedisExecutor executor) { var type = executor.ReadType(); if (type == RedisReplyType.Bulk) { var bytes = executor.ReadBulk(false); if (bytes == null || bytes.Length == 0) { return(null); } return(new BinaryValue(bytes)); } executor.AssertType(RedisReplyType.MultiBulk, type); executor.AssertSize(-1); return(null); }