I am writing the integer value in binary file as follows:-
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();
Value retrieved is: 1.092616E + 09
I am getting this value instead of '10'
Is there any other method to retrieve the int value?
x?ReadInt32line.. doesxhold10?