title: Append a string at the first line of file
body: <p>I used the code to insert a string into the file. However, that code only supports to insert at the last line of the file. Could you help me to change it to write a string at the first line of string in android. These strings are seperated by line.separator</p>
  
  <p>For example: 
  Current string in file</p>
  
  <pre><code>aaa
  bbb
  ccc
  </code></pre>
  
  <p>With new string is "111" please insert it as</p>
  
  <pre><code>111
  aaa
  bbb
  ccc
  </code></pre>
  
  <p>This is my code</p>
  
  <pre><code>private void writeTextFile(String filecontent)
  {           
          String filepath = Environment.getExternalStorageDirectory().getPath();
          String filename=filepath+"/" +  "/" + "filentxt.txt"    ;   
          FileOutputStream fop = null;
          File file = null;
  
          try {
              file =new File(filename);
              fop=new FileOutputStream(file,true);
              // if file doesn't exists, then create it
              if (!file.exists()) {
                  file.createNewFile();
              }
              filecontent=filecontent+ System.getProperty ("line.separator");
              // get the content in bytes
              byte[] contentInBytes = filecontent.getBytes();
              fop.write(contentInBytes);
              fop.flush();
              fop.close();
  
          } catch (IOException e) {
              e.printStackTrace();
          }
  }
  </code></pre>