title: BlockCopy a class? Getting "Object must be an array of primitives"
body: <p>I have an array full of instances of this class</p>
  
  <pre><code>public class TransformData {
      public float pos_x, pos_y, pos_z;
      public float rot_x, rot_y, rot_z;
      public float scale_x, scale_y, scale_z;
  }
  </code></pre>
  
  <p>I'm trying to convert this array to bytes using:</p>
  
  <pre><code>byte[] byteArray = new byte[transformArrayByteSizeHere];
  uffer.BlockCopy(transformArrayHere, 0, byteArray, 0, transformArrayByteSizeHere);
  </code></pre>
  
  <p>So that I can write a binary file. However I'm getting: "Object must be an array of primitives." I gather this means that I can only convert to bytes from types that C# already knows about, such a float? But why? My class is full of primitive types... I feel as though it should know how to do this. What am I missing?</p>