public QueryableMultiValueData(MemoryStream keyStream, MemoryStream valueStream, DimensionSet dimensionSet)
                : base(dimensionSet)
            {
                if (keyStream.Length == 0)
                {
                    this.keys = new BufferedKeyedData <uint>(null, 0, 0, dimensionSet);
                    keyStream.Dispose();
                    valueStream.Dispose();
                }
                else
                {
                    this.keyStream = keyStream;
                    this.keys      = new BufferedKeyedData <uint>(keyStream.GetBuffer(), 0, (int)keyStream.Length,
                                                                  dimensionSet);

                    this.values      = BufferedValueArray.Create(valueStream.GetBuffer(), 0, (int)valueStream.Length);
                    this.valueStream = valueStream;
                }
            }
            public QueryableMultiValueData(PersistedDataType type, MemoryStream source, DimensionSet dimensionSet, int keyCount)
                : base(dimensionSet)
            {
                if (source.Length == 0)
                {
                    this.keys = new BufferedKeyedData <uint>(null, 0, 0, dimensionSet);
                    source.Dispose();
                }
                else
                {
                    this.keyStream   = source;
                    this.valueStream = null;
                    var keyPortionLength = (int)BufferedKeyedData <uint> .GetBufferSizeForKeyCount(keyCount, dimensionSet);

                    var sourceBuffer = source.GetBuffer();
                    var sourceLength = (int)source.Length;

                    this.keys   = new BufferedKeyedData <uint>(sourceBuffer, 0, keyPortionLength, dimensionSet);
                    this.values = BufferedValueArray.Create(type, sourceBuffer,
                                                            keyPortionLength, sourceLength - keyPortionLength);
                }
            }