Beispiel #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, Half4 value)
 {
     unsafe
     {
         *((Half4 *)(_buffer + positionInBytes)) = value;
     }
 }
Beispiel #2
0
 public unsafe void Write(Half4 value)
 {
     if (!this._canWrite)
     {
         throw new NotSupportedException();
     }
     *(Half4 *)(this._buffer + this._position) = value;
     this._position += 8L;
 }
Beispiel #3
0
        public unsafe Half4 ReadHalf4()
        {
            if (!this._canRead)
            {
                throw new NotSupportedException();
            }
            Half4 half4 = *(Half4 *)(this._buffer + this._position);

            this._position += 8L;
            return(half4);
        }
Beispiel #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(Half4 value)
 {
     if (!_canWrite)
     {
         throw new NotSupportedException();
     }
     unsafe
     {
         *((Half4 *)(_buffer + _position)) = value;
         _position += 2 * 4;
     }
 }
Beispiel #5
0
        /// <summary>
        /// Reads a Half4.
        /// </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 Half4 from the stream</returns>
        public Half4 ReadHalf4()
        {
            unsafe
            {
                if (!_canRead)
                {
                    throw new NotSupportedException();
                }

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