title: Serialization Exception: End of Stream encountered before parsing was completed - C#
body: <p>I'm trying to convert a byte array to an object.  To eliminate any possible problems I created a simple windows form that simply calls the function that is breaking in my original code and I get the same error.  Any thoughts as to what is going on?</p>
  
  <pre><code>    private void button1_Click(object sender, EventArgs e)
      {
          byte[] myArray = new byte[] {1, 2, 3, 4, 5, 6, 7};
          object myObject = ByteArrayToObject(myArray);
  
          if(myObject != null)
          {
              button1.Text = "good";
          }
      }
  
      private object ByteArrayToObject(byte[] arrBytes)
      {
          System.Runtime.Serialization.Formatters.Binary.BinaryFormatter binForm = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
          MemoryStream memStream = new MemoryStream(arrBytes);
          memStream.Position = 0;
          return binForm.Deserialize(memStream);
      }
  </code></pre>