Exemple #1
0
        /// <summary>
        /// Converts the <see cref="BitValue" /> array using the <see cref="OutputType" /> .
        /// </summary>
        /// <param name="type">The <see cref="OutputType" /> .</param>
        /// <param name="value">The <see cref="BitValue" /> array.</param>
        /// <param name="output">
        /// The <see cref="BitValue" /> array to store the result in.
        /// </param>
        public static void Convert(this OutputType type, BitValue[] value, ref BitValue[] output)
        {
            Assert.Validate.IsNotNull(output, "Cannot perform operation. Output array is null");
            Assert.Validate.AreEqual(
                value.Length,
                output.Length,
                "Cannot perform operation. Output is not the correct length.");

            for (var i = 0; i < value.Length; i++)
            {
                output[i] = type.Convert(value[i]);
            }
        }