Exemplo n.º 1
0
 private static int BulkString(RedisBuffer redisBuffer, int i, params int[] words)
 {
     foreach (var word in words)
     {
         redisBuffer.WriteByte(TYPE_BULK_STRINGS, i);
         i++;
         i += word.DigitsCount().FastToArrayByte(redisBuffer, i);
         redisBuffer.CopyFrom(CRLF, 0, i, CRLFLength);
         i += CRLFLength;
         i += word.FastToArrayByte(redisBuffer, i);
         redisBuffer.CopyFrom(CRLF, 0, i, CRLFLength);
         i += CRLFLength;
     }
     return i;
 }
Exemplo n.º 2
0
 private static int BulkString(RedisBuffer redisBuffer, int i, params byte[][] words)
 {
     foreach (var word in words)
     {
         redisBuffer.WriteByte(TYPE_BULK_STRINGS, i++);
         var wordLength = word.Length;
         i += wordLength.FastToArrayByte(redisBuffer, i);
         redisBuffer.CopyFrom(CRLF, 0, i, CRLFLength);
         i += CRLFLength;
         redisBuffer.CopyFrom(word, 0, i, wordLength);
         i += wordLength;
         redisBuffer.CopyFrom(CRLF, 0, i, CRLFLength);
         i += CRLFLength;
     }
     return i;
 }