Class FileHandler

java.lang.Object
  extended byFileHandler

public class FileHandler
extends java.lang.Object

FileHandler opens and closes files


Constructor Summary
FileHandler()
           
 
Method Summary
 void close(java.io.Reader reader)
          Closes a Reader
 void close(java.io.Writer writer)
          Closes a Writer
 java.io.BufferedReader openInput(java.lang.String fileName, java.lang.String encoding)
          Opens a file for input
 java.io.BufferedWriter openOutput(java.lang.String fileName, java.lang.String encoding)
          Opens a file for output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHandler

public FileHandler()
Method Detail

openInput

public java.io.BufferedReader openInput(java.lang.String fileName,
                                        java.lang.String encoding)
Opens a file for input

Parameters:
fileName - The file to be opened
encoding - The encoding
Returns:
BufferedReader The reader for reading from the file

openOutput

public java.io.BufferedWriter openOutput(java.lang.String fileName,
                                         java.lang.String encoding)
Opens a file for output

Parameters:
fileName - The file to be opened
encoding - The encoding
Returns:
BufferedWriter The writer for writing to the file

close

public void close(java.io.Writer writer)
Closes a Writer

Parameters:
writer - The writer to be closed

close

public void close(java.io.Reader reader)
Closes a Reader

Parameters:
reader - The reader to be closed