/// <summary>
        /// Constructor for the result which asynchronously buffers into the memory the supplied result before closing
        /// it.
        /// </summary>
        ///
        /// <param name="result">The result which is to be buffered into memory and closed.</param>
        ///
        /// <returns>The <see cref="AsyncBufferedResult"/> object.</returns>
        public static async Task <AsyncBufferedResult> BufferResultAsync(IAsyncResult result)
        {
            var values = new List <IIonValue>();

            await foreach (IIonValue value in result)
            {
                values.Add(value);
            }

            return(new AsyncBufferedResult(values, result.GetConsumedIOs(), result.GetTimingInformation()));
        }