/// <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); } } }
/// <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]); } } }
/// <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 ] ); } } }
/// <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 ); } } }