title: JSON and Binary file in WPF
body: <p>I save a text file with JSON in WPF by the following code:</p>
  
  <pre><code>using (JsonWriter file = new JsonTextWriter(new StreamWriter("Test.txt")))
  {
     file.Formatting = Formatting.Indented;
     file.WriteStartObject();
     file.WritePropertyName("TEST");
     file.WriteValue("test");
     file.WriteEndObject();
  }
  </code></pre>
  
  <p>The file is saved in the following structure:</p>
  
  <pre><code>{
    "TEST": "test"
  }
  </code></pre>
  
  <p>I want to save the file as binary file.</p>
  
  <p>What I need to add / change in the code?</p>
  
  <p>I have tried to use with a 'JsonSerializer' object and with the 'Serialize()' function instead of 'WriteValue()' function, but nothing changed.</p>
  
  <p>I will be so happy to get a working sample code.</p>
  
  <p>Thanks...</p>