title: How to insert text after a particular line of a file
body: <p>I have a file of 250 line. I wanted to insert some text after line 128.</p>
  
  <p>I only found that I can append a text at the end of file
  like </p>
  
  <pre><code>try {
      PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("outfilename", true)));
      out.println("the text");
      out.close();
  } catch (IOException e) {
      //oh noes!
  }
  </code></pre>
  
  <p>That is found on this post <a href="https://stackoverflow.com/questions/1625234/how-to-append-text-to-an-existing-file-in-java">How to append text to an existing file in Java</a> </p>
  
  <p>But with no mention to the line number or sth.</p>