Exemple #1
0
 internal bool TryGetInt64(out long value)
 {
     if (arr == null)
     {
         value = 0;
         return(false);
     }
     return(RedisValue.TryParseInt64(arr as byte[], offset, count, out value));
 }
Exemple #2
0
        internal bool TryGetInt64(out long value)
        {
            if (IsNull || Payload.IsEmpty || Payload.Length > PhysicalConnection.MaxInt64TextLen)
            {
                value = 0;
                return(false);
            }

            if (Payload.IsSingleSegment)
            {
                return(RedisValue.TryParseInt64(Payload.First.Span, out value));
            }

            Span <byte> span = stackalloc byte[(int)Payload.Length]; // we already checked the length was <= MaxInt64TextLen

            Payload.CopyTo(span);
            return(RedisValue.TryParseInt64(span, out value));
        }