Exemple #1
0
        /// <summary>
        /// Writes a generic value to a byte array.
        /// </summary>
        /// <param name="data">Binary data stream, in which should be written.</param>
        /// <param name="value">Value that should be seralized and written to the binary stream.</param>
        /// <param name="index">Byte position of the values within the array.</param>
        public virtual void SetValue <T>(byte[] data, T value, int index)
        {
            ConversionHandler <T> converter = _genericHandlers[typeof(T)] as ConversionHandler <T>;

            if (converter != null)
            {
                converter.SetMethod(data, value, index);
            }
            else
            {
                throw new ArgumentException();
            }
        }