read and write in java
<p>I want print in the file every time line
But every time i want print a new line printed on the same line the old.</p>

<p>I want to print lines in the file </p>

<p>This my code</p>

<pre><code>BufferedReader read = new BufferedReader(new FileReader (SecurityScreen.path.get("ScoreFile")));
FileWriter file ;
BufferedWriter write = new BufferedWriter ( new FileWriter(SecurityScreen.path.get("ScoreFile")));
String temp = "" ;
String output = "";
String newLine = System.getProperty("line.separator");
String score= SecurityScreen.getPlayer() + "@" +gameTime + newLine;
//    if(read.readLine()==null){
//       write.write(score);
//          }
try{
    if((temp = read.readLine()) != null){
        while (true) {
            output += temp + newLine;
            file = new FileWriter(SecurityScreen.path.get("ScoreFile"));
            //write = new BufferedWriter(file);
            write.write(output + newLine) ; 
            //score =   SecurityScreen.getPlayer() + "@" +gameTime ;
            write.write(score) ;
        }
    }
    else {
        write.write(score);
    }

    write.close(); 
}
catch(IOException e){
}
</code></pre>
