예제 #1
0
 private void EqualsDetectsDeltaForAllLocations(ReadableBuffer slice, byte[] expected, int offset, int length)
 {
     Assert.Equal(length, slice.Length);
     Assert.True(slice.EqualsTo(new Span <byte>(expected, offset, length)));
     // change one byte in buffer, for every position
     for (int i = 0; i < length; i++)
     {
         expected[offset + i] ^= 42;
         Assert.False(slice.EqualsTo(new Span <byte>(expected, offset, length)));
         expected[offset + i] ^= 42;
     }
 }
예제 #2
0
        private bool EqualsIgnoreCase(ref ReadableBuffer key, byte[] buffer)
        {
            if (key.Length != buffer.Length)
            {
                return(false);
            }

            return(key.EqualsTo(buffer));
        }