Example #1
0
 /// <summary>
 /// Sets the specified value.
 /// </summary>
 /// <param name="positionInBytes">Relative position in bytes from the beginning of the buffer to set the data to.</param>
 /// <param name="value">The value.</param>
 public void Set(int positionInBytes, Half2 value)
 {
     unsafe
     {
         *((Half2 *)(_buffer + positionInBytes)) = value;
     }
 }
Example #2
0
 public unsafe void Write(Half2 value)
 {
     if (!this._canWrite)
     {
         throw new NotSupportedException();
     }
     *(Half2 *)(this._buffer + this._position) = value;
     this._position += 4L;
 }
Example #3
0
        public unsafe Half2 ReadHalf2()
        {
            if (!this._canRead)
            {
                throw new NotSupportedException();
            }
            Half2 half2 = *(Half2 *)(this._buffer + this._position);

            this._position += 4L;
            return(half2);
        }
Example #4
0
 /// <summary>
 /// Writes the specified value.
 /// </summary>
 /// <remarks>
 /// In order to provide faster read/write, this operation doesn't check stream bound.
 /// A client must carefully not read/write above the size of this datastream.
 /// </remarks>
 /// <param name="value">The value.</param>
 public void Write(Half2 value)
 {
     if (!_canWrite)
     {
         throw new NotSupportedException();
     }
     unsafe
     {
         *((Half2 *)(_buffer + _position)) = value;
         _position += 2 * 2;
     }
 }
Example #5
0
        /// <summary>
        /// Reads a Half2.
        /// </summary>
        /// <remarks>
        /// In order to provide faster read/write, this operation doesn't check stream bound.
        /// A client must carefully not read/write above the size of this datastream.
        /// </remarks>
        /// <returns>an Half2 from the stream</returns>
        public Half2 ReadHalf2()
        {
            unsafe
            {
                if (!_canRead)
                {
                    throw new NotSupportedException();
                }

                Half2 value = *((Half2 *)(_buffer + _position));
                _position += 2 * 2;
                return(value);
            }
        }
Example #6
0
 public unsafe void Set(int positionInBytes, Half2 value)
 {
     *(Half2 *)(this._buffer + positionInBytes) = value;
 }