How can I prevent PrintWriter from printing a blank line at the beginning of each file?
<p>I'm trying to write a couple of methods to save a binary tree to a file. They work correctly, except for a slight problem. The problem is that a blank line is inserted at the beginning of each file that's created. Why is PrintWriter doing this, and how can I prevent it from happening?</p>

<p>Here's my code:</p>

<pre><code>import java.io.*;

void callSaveGame(String fileName) throws IOException {
    PrintWriter out = new PrintWriter(new FileWriter("X:\\path\\to\\save\\directory\\" + fileName)); // associate PrintWriter with file

    saveGame(root, out);

    out.close();
}

void saveGame(Node current, PrintWriter out) {
    if (current != null) {
        out.println(current.getData()); // print node to file

        saveGame(current.getLChild(), out); // call for left child(ren)

        saveGame(current.getRChild(), out); // call for right child(ren)
    }
}
</code></pre>
