title: FileReader and BufferedReader
body: <p>I have 3 methods</p>
  
  <ol>
  <li>for open file</li>
  <li>for read file </li>
  <li>for return things read in method read</li>
  </ol>
  
  <p>this my code :            </p>
  
  <pre><code>/*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package javaapplication56;
  
  import java.io.BufferedReader;
  import java.io.File;
  import java.io.FileReader;
  import java.io.IOException;
  import java.rmi.RemoteException;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  /**
   *
   * @author x
   */
  public class RemoteFileObjectImpl extends java.rmi.server.UnicastRemoteObject  implements RemoteFileObject
  {
      public RemoteFileObjectImpl() throws java.rmi.RemoteException {
          super();
      }
  
      File f = null;
      FileReader r = null;
      BufferedReader bfr = null;
  
      String output = "";
      public void open(String fileName) {
          //To read file passWord
          f = new File(fileName);
      }
      public String readLine() {
          try {
              String temp = "";
              String newLine = System.getProperty("line.separator");
              r = new FileReader(f);
              while ((temp = bfr.readLine()) != null) {
                  output += temp + newLine;
                  bfr.close();
              }
          }
          catch (IOException ex) {
             ex.printStackTrace();
          }
  
          return output;
      }
  
      public void close() {
          try {
              bfr.close();
          } catch (IOException ex) {
          }
      }
  
      public static void main(String[]args) throws RemoteException{
          RemoteFileObjectImpl m = new RemoteFileObjectImpl();
          m.open("C:\\Users\\x\\Documents\\txt.txt");
          m.readLine();
          m.close();
      } 
  }
  </code></pre>
  
  <p>But it does not work.</p>