Copies the specified amount of bytes from source buffer to destination. - CSharp System

CSharp examples for System:Byte

Description

Copies the specified amount of bytes from source buffer to destination.

Demo Code


using System.Runtime.InteropServices;
using System.Linq;
using System.Collections.Generic;
using System.Collections;
using System;//from   www  . j  av a  2 s  . c om

public class Main{
        /// <summary>
        /// Copies the specified amount of bytes from source buffer to destination.
        /// </summary>
        /// <param name="to">Destination.</param>
        /// <param name="from">Source.</param>
        /// <param name="byteCount">The amount of bytes to copy.</param>
        public static void CopyBytes(ArrayPtr<T> to, ArrayPtr<T> from, int byteCount)
        {
            Buffer.BlockCopy(from._buffer, from._index * SIZEOF_SAMPLETYPE, to._buffer, to._index * Marshal.SizeOf(typeof(T)), byteCount);
        }
}

Related Tutorials