/// <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, Half3 value) { unsafe { *((Half3 *)(_buffer + positionInBytes)) = value; } }
public unsafe void Write(Half3 value) { if (!this._canWrite) { throw new NotSupportedException(); } *(Half3 *)(this._buffer + this._position) = value; this._position += 6L; }
public unsafe Half3 ReadHalf3() { if (!this._canRead) { throw new NotSupportedException(); } Half3 half3 = *(Half3 *)(this._buffer + this._position); this._position += 6L; return(half3); }
/// <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(Half3 value) { if (!_canWrite) { throw new NotSupportedException(); } unsafe { *((Half3 *)(_buffer + _position)) = value; _position += 2 * 3; } }
/// <summary> /// Reads a Half3. /// </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 Half3 from the stream</returns> public Half3 ReadHalf3() { unsafe { if (!_canRead) { throw new NotSupportedException(); } Half3 value = *((Half3 *)(_buffer + _position)); _position += 2 * 3; return(value); } }
public unsafe void Set(int positionInBytes, Half3 value) { *(Half3 *)(this._buffer + positionInBytes) = value; }