コード例 #1
0
ファイル: Serializer.cs プロジェクト: bostich83/axiom
        /// <summary>
        ///		Reads a specified number of shorts and copies them into the destination pointer.
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="count">Number of values to read.</param>
        /// <param name="dest">Pointer to copy the values into.</param>
        protected void ReadShorts(BinaryReader reader, int count, BufferBase dest)
        {
            // blast the data into the buffer
#if !AXIOM_SAFE_ONLY
            unsafe
#endif
            {
                var pointer = dest.ToShortPointer();
                for (var i = 0; i < count; i++)
                {
                    pointer[i] = ReadShort(reader);
                }
            }
        }
コード例 #2
0
ファイル: Serializer.cs プロジェクト: bostich83/axiom
        /// <summary>
        ///		Writes a specified number of shorts.
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="count">Number of values to write.</param>
        /// <param name="src">Pointer that holds the values.</param>
        protected void WriteShorts(BinaryWriter writer, int count, BufferBase src)
        {
            // blast the data into the buffer
#if !AXIOM_SAFE_ONLY
            unsafe
#endif
            {
                var pointer = src.ToShortPointer();

                for (var i = 0; i < count; i++)
                {
                    writer.Write(pointer[i]);
                }
            }
        }
コード例 #3
0
ファイル: Serializer.cs プロジェクト: ryan-bunker/axiom3d
		/// <summary>
		///		Writes a specified number of shorts.
		/// </summary>
		/// <param name="writer"></param>
		/// <param name="count">Number of values to write.</param>
		/// <param name="src">Pointer that holds the values.</param>
		protected void WriteShorts( BinaryWriter writer, int count, BufferBase src )
		{
			// blast the data into the buffer
#if !AXIOM_SAFE_ONLY
			unsafe
#endif
			{
				var pointer = src.ToShortPointer();

				for ( var i = 0; i < count; i++ )
				{
					writer.Write( pointer[ i ] );
				}
			}
		}
コード例 #4
0
ファイル: Serializer.cs プロジェクト: ryan-bunker/axiom3d
		/// <summary>
		///		Reads a specified number of shorts and copies them into the destination pointer.
		/// </summary>
		/// <param name="reader"></param>
		/// <param name="count">Number of values to read.</param>
		/// <param name="dest">Pointer to copy the values into.</param>
		protected void ReadShorts( BinaryReader reader, int count, BufferBase dest )
		{
			// blast the data into the buffer
#if !AXIOM_SAFE_ONLY
			unsafe
#endif
			{
				var pointer = dest.ToShortPointer();
				for ( var i = 0; i < count; i++ )
				{
					pointer[ i ] = ReadShort( reader );
				}
			}
		}