Not able to write into the file
<p>I am trying to create a file and keep on appending into that file. In my code file is getting created but It is not appending anything in that file. Don't know why? Can anyone suggest me what wrong I am doing..</p>

<p><strong>Updated Code:-</strong> </p>

<pre><code>        File file =new File("D://GeoData1.txt");

    BufferedWriter out = new BufferedWriter(new FileWriter(file, true));


    int j = -1;
    while(true) {           
        j++;
        String ipAddress = generateIPAddress(j);
        try {
            out.write(ipAddress);
            System.out.println(ipAddress);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                    out.flush();
                    out.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
</code></pre>
