title: can i use this same as with byte to other types values / objects?
body: <p>As my goal is to out perform the <i><code>List&lt;T&gt;</code></i>
  i am testing arrays and found few starting points to get on testing 
  i have tested this before trying to capture bitmaps off screen,
  and tests proved the usage is suffice.
  my question is what data types could use this Copy() code except for byte[]</p>
  
  <p>say i want a data storage unit to take the advantage of unmanaged / unsafe </p>
  
  <pre><code>        public unsafe struct NusT
          {
              public unsafe int vi;
              public unsafe bool vb;
          }
  </code></pre>
  
  <p>instead of populating a list </p>
  
  <p>i initialise the struct as follows : 1)</p>
  
  <pre><code>NusT n; 
  n.vi= 90;
  n.vb=true
  </code></pre>
  
  <p>i have tested this after testing the folowing: 2)</p>
  
  <pre><code>NusT n = new NusT(){vi=90, vb=true};
  </code></pre>
  
  <p>this test was after testing :3)</p>
  
  <pre><code>NusT n = new NusT("90", true);
  </code></pre>
  
  <p>i think both last had same results but the first one is blazing fast, as i do not create an object so </p>
  
  <pre><code>NusT n-&gt; instructions- 1
  n.vi=90 -&gt; instructions- 1
  n.vb=true -&gt; instructions- 1 
  </code></pre>
  
  <p>now i minimized what i could and this started at the begining with a class:
  whitch was even worse than 2 &amp; 3 above as it also uses properties</p>
  
  <pre><code>class bigAndSlow
  {
       public int a { get; private set;}
       public bool b { get; private set;}
       public string  c { get; private set;}
  
       public bigAndSlow(int .. ,boo .. , string.. )
       {
          initialise ...
       }
  }
  </code></pre>
  
  <p>so now when the final decision is </p>
  
  <pre><code>        public unsafe struct NusT
          {
              public unsafe int vi;
              public unsafe bool vb;
          }
  </code></pre>
  
  <h1>how can i implement this blazingly fast data unit to use Copy() on</h1>
  
  <pre><code>NusT[] NustyArr;
  
  
      static unsafe void Copy(byte[] src, int srcIndex,
              byte[] dst, int dstIndex, int count)
          {
              if (src == null || srcIndex &lt; 0 ||
                  dst == null || dstIndex &lt; 0 || count &lt; 0)
              {
                  throw new ArgumentException();
              }
              int srcLen = src.Length;
              int dstLen = dst.Length;
              if (srcLen - srcIndex &lt; count ||
                  dstLen - dstIndex &lt; count)
              {
                  throw new ArgumentException();
              }
  
  
              // The following fixed statement pins the location of
              // the src and dst objects in memory so that they will
              // not be moved by garbage collection.          
              fixed (byte* pSrc = src, pDst = dst)
              {
                  byte* ps = pSrc;
                  byte* pd = pDst;
  
                  // Loop over the count in blocks of 4 bytes, copying an
                  // integer (4 bytes) at a time:
                  for (int n = 0; n &lt; count / 4; n++)
                  {
                      *((int*)pd) = *((int*)ps);
                      pd += 4;
                      ps += 4;
                  }
  
                  // Complete the copy by moving any bytes that weren't
                  // moved in blocks of 4:
                  for (int n = 0; n &lt; count % 4; n++)
                  {
                      *pd = *ps;
                      pd++;
                      ps++;
                  }
              }
          }
  
  
          static void Main(string[] args)
          {
              byte[] a = new byte[100];
              byte[] b = new byte[100];
              for (int i = 0; i &lt; 100; ++i)
                  a[i] = (byte)i;
              Copy(a, 0, b, 0, 100);
              Console.WriteLine("The first 10 elements are:");
              for (int i = 0; i &lt; 10; ++i)
                  Console.Write(b[i] + " ");
              Console.WriteLine("\n");
          }
  </code></pre>