Ejemplo n.º 1
0
        /// <summary>
        /// Retrieves a segment of binary representation
        /// of the value referenced by the specified key.
        /// </summary>
        /// <param name="key">The key</param>
        /// <param name="startIndex">The index in binary representation where the specified segment starts</param>
        /// <param name="endIndex">The index in binary representation where the specified segment ends</param>
        /// <returns></returns>
        public byte[] GetRawDataSegment(TKey key, long startIndex, long endIndex)
        {
            var            binaryKey = _keySerializer.Serialize(key);
            bool           isFullMatch;
            IRadixTreeNode node = FindMostSuitableNode(binaryKey, out _, out _, out isFullMatch);

            if (!isFullMatch)
            {
                return(null);
            }

            return(node.ValueReference != null?_valueStorage.GetRawDataSegment(node.ValueReference, startIndex, endIndex) : null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Retrieves a segment of binary representation
        /// of the value referenced by the specified key.
        /// </summary>
        /// <param name="key">The key</param>
        /// <param name="startIndex">The index in binary representation where the specified segment starts</param>
        /// <param name="endIndex">The index in binary representation where the specified segment ends</param>
        /// <returns></returns>
        public byte[] GetRawDataSegment(TKey key, long startIndex, long endIndex)
        {
            var entry = FindSuitableEntry(key);

            return(entry.HasValue ? _valueStorage.GetRawDataSegment(entry.Value.Value, startIndex, endIndex) : null);
        }