BplusDotNet.xBplusTreeBytes.FindBucketForPrefix C# (CSharp) Method

FindBucketForPrefix() public method

public FindBucketForPrefix ( string key, xBucket &bucket, string &prefix, bool keyIsPrefix ) : bool
key string
bucket xBucket
prefix string
keyIsPrefix bool
return bool
        public bool FindBucketForPrefix(string key, out xBucket bucket, out string prefix, bool keyIsPrefix)
        {
            bucket = null;
            prefix = key;
            if (!keyIsPrefix)
            {
                prefix = PrefixForByteCount(key, this.prefixLength);
            }
            object datathing = this.tree.Get(prefix, "");
            if (datathing is byte[])
            {
                byte[] databytes = (byte[]) datathing;
                bucket = new xBucket(this);
                bucket.Load(databytes);
                if (bucket.Count()<1)
                {
                    throw new BplusTreeException("empty bucket loaded");
                }
                return true;
            }
            return false; // default
        }