private bool TryAddInternal(byte[] key, T value)
        {
            var h     = ByteArrayGetHashCode(key, 0, key.Length);
            var entry = new Entry {
                Key = key, Value = value
            };

            var array = _buckets[h & (_indexFor)];

            if (array == null)
            {
                _buckets[h & (_indexFor)] = new[] { entry };
            }
            else
            {
                // check duplicate
                for (var i = 0; i < array.Length; i++)
                {
                    var e = array[i].Key;
                    if (ByteArrayComparer.Equals(key, 0, key.Length, e))
                    {
                        return(false);
                    }
                }

                var newArray = new Entry[array.Length + 1];
                Array.Copy(array, newArray, array.Length);
                array = newArray;
                array[array.Length - 1]   = entry;
                _buckets[h & (_indexFor)] = array;
            }

            return(true);
        }
        public bool TryGetValue(ArraySegment <byte> key, out T value)
        {
            var table = _buckets;
            var hash  = ByteArrayGetHashCode(key.Array, key.Offset, key.Count);
            var entry = table[hash & _indexFor];

            if (entry == null)
            {
                goto NOT_FOUND;
            }

            {
                var v = entry[0];
                if (ByteArrayComparer.Equals(key.Array, key.Offset, key.Count, v.Key))
                {
                    value = v.Value;
                    return(true);
                }
            }

            for (var i = 1; i < entry.Length; i++)
            {
                var v = entry[i];
                if (ByteArrayComparer.Equals(key.Array, key.Offset, key.Count, v.Key))
                {
                    value = v.Value;
                    return(true);
                }
            }

NOT_FOUND:
            value = default;
            return(false);
        }