title: FILO java writing strategy in a text file
body: <p>I want to apply the "First In last out" strategy in a text file</p>
  
  <p>Assuming that I have a file containing some "measurements", and I don't want it to contain more than 10 lines, I'm accessing to it to :</p>
  
  <ul>
  <li>If &lt; 10 = insert a value and write lines in other support</li>
  <li>If >= 10 = insert a value and write only the last 10 lines (and delete others)</li>
  </ul>
  
  <p>To make it simple, assuming that my file look like
  (to not charge it some much, I'll just put some line break as it was in java)</p>
  
  <p>File : </p>
  
  <pre><code>1 "\n" 2 "\n" 3 "\n" 4 "\n" 5 "\n" 6 "\n" 7 "\n" 8 "\n" 9 "\n" 10
  </code></pre>
  
  <p>Now I want to insert a new data in the file and get the last 10, new data is <strong>11</strong> :</p>
  
  <p>My file should look like :</p>
  
  <pre><code>2 "\n" 3 "\n" 4 "\n" 5 "\n" 6 "\n" 7 "\n" 8 "\n" 9 "\n" 10 "\n" 11
  </code></pre>
  
  <p>Is there a way to do this in java ?</p>