SetValue() public method

Sets the raw bytes of the value that this scalar represents.
public SetValue ( byte value, int offset ) : void
value byte The array containing the bytes.
offset int The offset into the array at which the value starts.
return void
Exemplo n.º 1
0
        /// <summary>
        /// Updates the value of the scalar element identified by the given tag
        /// or adds a new scalar element if one does not already exist.
        /// </summary>
        /// <param name="tag">The tag which identifies the scalar element to be updated.</param>
        /// <param name="type">The physical type of the value contained in the scalar element.</param>
        /// <param name="bytes">The value to be entered into the scalar element.</param>
        /// <returns>The scalar element which was updated, or a new scalar element if one did not already exist.</returns>
        public ScalarElement AddOrUpdateScalar(Guid tag, PhysicalType type, byte[] bytes)
        {
            ScalarElement scalarElement = GetOrAddScalar(tag);

            scalarElement.TypeOfValue = type;
            scalarElement.SetValue(bytes, 0);
            return(scalarElement);
        }
Exemplo n.º 2
0
        // Reads a scalar element from the PQDIF file.
        private ScalarElement ReadScalar(BinaryReader recordBodyReader, PhysicalType typeOfValue)
        {
            ScalarElement element = new ScalarElement()
            {
                TypeOfValue = typeOfValue
            };

            byte[] value = recordBodyReader.ReadBytes(typeOfValue.GetByteSize());

            element.SetValue(value, 0);

            return(element);
        }
Exemplo n.º 3
0
        // Reads a scalar element from the PQDIF file.
        private ScalarElement ReadScalar(BinaryReader recordBodyReader, PhysicalType typeOfValue)
        {
            ScalarElement element = new ScalarElement()
            {
                TypeOfValue = typeOfValue
            };

            byte[] value = recordBodyReader.ReadBytes(typeOfValue.GetByteSize());

            element.SetValue(value, 0);

            return element;
        }