Esempio n. 1
0
        // Get the data of a vector whoses offset is stored at "offset" in this object as an
        // T[]. If the vector is not present in the ByteBuffer, then a null value will be
        // returned.
        public T[] __vector_as_array <T>(int offset)
            where T : struct
        {
            if (!BitConverter.IsLittleEndian)
            {
                throw new NotSupportedException("Getting typed arrays on a Big Endian " +
                                                "system is not support");
            }

            var o = this.__offset(offset);

            if (0 == o)
            {
                return(null);
            }

            var pos = this.__vector(o);
            var len = this.__vector_len(o);

            return(bb.ToArray <T>(pos, len));
        }