   import java.io.*;
   import java.util.*;
    public class ReadClient
   {
      private ObjectInputStream input;
       public void openFile()
      {
         try
         {
            input = new ObjectInputStream (new FileInputStream("clients.ser"));
         }//end try
             catch(IOException ioException)
            {
               System.err.println("Error opening file");
            }//end catch IOException
      }//end open file
       public void readRecords()
      {
         AccountSerializable record;
         System.out.printf("%-10s%-12s%-12s%-10s\n","Account","First Name","Last Name","Balance");
         try
         {
            while(true)
            {
               record =(AccountSerializable) input.readObject();
               System.out.printf("%-10d%-12s%-12s%-10.2f\n", 
                  record.getAccount(), record.getFirstName(), record.getLastName(), record.getBalance());
            }//end while
         }//end try
             catch(EOFException eofRef)
            {
               return;
            }//end catch
             catch(ClassNotFoundException cnfeRef)
            {
               System.err.println("Unable to create object");
            }//end catch
             catch(IOException ioeRef)
            {
               System.err.println("Error during read from file");
            }//end catch
      		
      }//end Read
       public void closeFile()
      {
         try
         {
            if(input != null)
               input.close();
         }//end try
             catch(IOException ioeRef)
            {
               System.err.println("Error closing file");
               System.exit(1);
            }//end catch
      }//end close file
   	
   }//end class