SetValues() public méthode

Sets the raw bytes of the values contained by this vector.
public SetValues ( byte values, int offset ) : void
values byte The array that contains the raw bytes.
offset int The offset into the array at which the values start.
Résultat void
Exemple #1
0
        /// <summary>
        /// Updates the values contained by the vector element identified by the given tag
        /// or adds a new vector element if one does not already exist.
        /// </summary>
        /// <param name="tag">The tag which identifies the vector element to be updated.</param>
        /// <param name="type">The physical type of the values contained in the vector element.</param>
        /// <param name="bytes">The values to be entered into the vector element.</param>
        /// <returns>The vector element which was updated, or a new vector element if one did not already exist.</returns>
        public VectorElement AddOrUpdateVector(Guid tag, PhysicalType type, byte[] bytes)
        {
            VectorElement vectorElement = GetOrAddVector(tag);

            vectorElement.TypeOfValue = type;
            vectorElement.Size        = bytes.Length / type.GetByteSize();
            vectorElement.SetValues(bytes, 0);
            return(vectorElement);
        }
Exemple #2
0
        // Reads a vector element from the PQDIF file.
        private VectorElement ReadVector(BinaryReader recordBodyReader, PhysicalType typeOfValue)
        {
            VectorElement element = new VectorElement()
            {
                Size        = recordBodyReader.ReadInt32(),
                TypeOfValue = typeOfValue
            };

            byte[] values = recordBodyReader.ReadBytes(element.Size * typeOfValue.GetByteSize());

            element.SetValues(values, 0);

            return(element);
        }
Exemple #3
0
        // Reads a vector element from the PQDIF file.
        private VectorElement ReadVector(BinaryReader recordBodyReader, PhysicalType typeOfValue)
        {
            VectorElement element = new VectorElement()
            {
                Size = recordBodyReader.ReadInt32(),
                TypeOfValue = typeOfValue
            };

            byte[] values = recordBodyReader.ReadBytes(element.Size * typeOfValue.GetByteSize());

            element.SetValues(values, 0);

            return element;
        }