title: Converting a list of ints to a byte array
body: <p>I tried to use the <a href="https://msdn.microsoft.com/en-us/library/73fe8cwf(v=vs.110).aspx" rel="nofollow noreferrer">List.ConvertAll</a> method and failed. What I am trying to do is convert a <code>List&lt;Int32&gt;</code> to <code>byte[]</code></p>
  
  <p>I copped out and went this route, but I need to figure out the ConvertAll method...</p>
  
  <pre><code>List&lt;Int32&gt; integers...
  
  internal byte[] GetBytes()
  {
      List&lt;byte&gt; bytes = new List&lt;byte&gt;(integers.Count * sizeof(byte));
      foreach (Int32 integer in integers)
          bytes.AddRange(BitConverter.GetBytes(integer));
  
      return bytes.ToArray();
  }
  </code></pre>