title: Replacing old content of a text file with new content when we write the file second time
body: <p>Hi I am writing some data  to a text file through java code but when i again run the code its again appending to the older data ,i want the new data to overwrite the older version.
  can any one help..</p>
  
  <pre><code>BufferedWriter  out1 = new BufferedWriter(new FileWriter("inValues.txt" , true));
    for(String key: inout.keySet())
                  {
                      String val = inout.get(key);
                      out1.write(key+" , "+val+"\n");
                  }
                  out1.close();
  </code></pre>