title: C# - Byte arrays and file extensions
body: <p>I have a byte array that I've downloaded which lacks a file extension.  I need to give this file an extension, which in my case will always be .gif, and convert back to a byte array.</p>
  
  <p>I'm accomplishing the first step thus:</p>
  
  <pre><code>FileContentResult file = File(imageList.Single(), "image/gif");
  </code></pre>
  
  <p>I'm not sure what to do next.  FileContentResult has a FileContents parameter which is of type byte array.  I've tried using that, but it doesn't appear to contain the extension in the data.</p>
  
  <p>Do byte arrays even contain the extension type?  This is my first time working with one, so my understanding of what they are and what I can do with them is lacking.</p>