Exemplo n.º 1
0
        /// <summary>
        /// Gets the <see cref="short"/> value at a given index.
        /// </summary>
        /// <param name="index"> index in bytes from which to get.</param>
        /// <returns>the value at a given index.</returns>
        public short Int16GetBigEndian(int index)
        {
            var data = *(short *)(_pBuffer + index);

            data = EndianessConverter.ApplyInt16(ByteOrder.BigEndian, data);
            return(data);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Writes a <see cref="short"/> value to a given index.
        /// </summary>
        /// <param name="index">index in bytes for where to put.</param>
        /// <param name="value">value to be written</param>
        public void Int16PutBigEndian(int index, short value)
        {
            value = EndianessConverter.ApplyInt16(ByteOrder.BigEndian, value);

            *(short *)(_pBuffer + index) = value;
        }