I am trying to write and read a binary file using c# BinaryWriter and BinaryReader classes. When I am storing a string in file, it is storing it properly, but when I am trying to read it is returning a string which has '\0' character on every alternate place within the string.
Here is the code:
 public void writeBinary(BinaryWriter bw)
 {
     bw.Write("Hello");
 }
 public void readBinary(BinaryReader br)
 {
     BinaryReader br = new BinaryReader(fs);
     String s;
     s = br.ReadString();
  }
Here s is getting value as = "H\0e\0l\0l\0o\0".
 
     
    