title: How to convert a Byte* from C++ to Byte[] in C#
body: <p>I have a library in C++ containing a library returning a Byte* :</p>
  
  <pre><code>typedef unsigned char Byte;
  Byte* RotateImage90(Byte* data, int w, int h);
  </code></pre>
  
  <p>I'm using this library in a program in C# (Xamarin) :</p>
  
  <pre><code>[DllImport("libCpp", EntryPoint = "RotateImage90")]
  public static extern IntPtr rotate90(byte[] data, int w, int h);
  
  Byte[] test(Byte[] data, int w, int h)
  {
      IntPtr ptr = rotate90(data, w, h);
      Byte[] img = ????;// &lt;= function missing
      return img;
  }
  </code></pre>
  
  <p>It works good, but I don't know how to convert the pointer to a Byte array. Someone know a function to do that ?</p>