title: java, the principle logic behind l = inputStream.readLine()) != null
body: <p>I'm new to java and is having trouble understand some of the basic principles shown by the example below. Could someone please explain the meaning of l = inputStream.readLine()) != null in the context of the code below? your help would be greatly appreciated.</p>
  
  <pre><code>import java.io.FileReader;
  import java.io.FileWriter;
  import java.io.BufferedReader;
  import java.io.PrintWriter;
  import java.io.IOException;
  
  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>