title: How to retrieve integer value from binary file in C#
body: <p>I am writing the integer value in binary file as follows:-</p>
  
  <pre><code>int val =10;
  
  FileStream fs = new FileStream("BinaryFile.bin", FileMode.Create);
              BinaryWriter bw = new BinaryWriter(fs, Encoding.Unicode);
  
  bw.Write(val);
  
  //Reading value from binary as:-
  
  FileStream fs = new FileStream("BinaryFile.bin", FileMode.Open);
    BinaryReader br = new BinaryReader(fs, Encoding.Unicode);
  
  int x = br.ReadInt32();
  </code></pre>
  
  <p>Value retrieved is: 1.092616E + 09</p>
  
  <p>I am getting this value instead of '10'</p>
  
  <p>Is there any other method to retrieve the int value?</p>