Exemple #1
0
        /// <summary>
        /// Gets a copy of the key's array value. Changing the values of this array does not affect the owning message.
        /// Call ::AsXArray(alteredArray) to set new values.
        /// </summary>
        /// <returns>Returns a *copy* of the key's array.</returns>
        public virtual double[] AsDoubleArray()
        {
            AssertTypeSafe(GribValueType.DoubleArray);

            SizeT sz = 0;

            GribApiProxy.GribGetSize(_handle, Key, ref sz);

            double[] values = new double[sz];
            GribApiProxy.GribGetDoubleArray(_handle, Key, values, ref sz);

            return(values);
        }
Exemple #2
0
        /// <summary>
        /// Gets the key's value in bytes.
        /// </summary>
        /// <returns></returns>
        public byte[] AsBytes()
        {
            AssertTypeSafe(GribValueType.Bytes);

            SizeT sz = 0;

            GribApiProxy.GribGetSize(_handle, Key, ref sz);
            byte[] bytes = new byte[sz];

            GribApiProxy.GribGetBytes(_handle, Key, bytes, ref sz);

            return(bytes);
        }
Exemple #3
0
        /// <summary>
        /// Gets a copy of the key's array value. Changing the values of this array does not affect the owning message.
        /// Call ::AsXArray(alteredArray) to set new values.
        /// </summary>
        /// <returns>Returns a *copy* of the key's array.</returns>
        public virtual int[] AsIntArray()
        {
            AssertTypeSafe(GribValueType.IntArray);

            SizeT sz = 0;

            GribApiProxy.GribGetSize(_handle, Key, ref sz);

            int[] values = new int[sz];
            GribApiProxy.GribGetLongArray(_handle, Key, values, ref sz);

            return(values);
        }