finally { if (inputStream != null) { inputStream.close();
<p>I don't know how to understand this:</p>

<pre><code>{
        if (inputStream **!= null**) {
            inputStream.close();
</code></pre>

<p>from that example:</p>

<pre><code>public class CopyLines {
public static void main(String[] args) throws IOException {

    BufferedReader inputStream = null;
    PrintWriter outputStream = null;

    try {
        inputStream = new BufferedReader(new FileReader("xanadu.txt"));
        outputStream = new PrintWriter(new FileWriter("characteroutput.txt"));

        String l;
        while ((l = inputStream.readLine()) != null) {
            outputStream.println(l);
        }
    } finally {
        if (inputStream != null) {
            inputStream.close();
        }
        if (outputStream != null) {
            outputStream.close();
        }
    }
}}
</code></pre>

<p>inputStream is beeing closed when there is any data provided???</p>