de.tuberlin.cs.cis.ocl.util
Class FileReaderExtension

java.lang.Object
  |
  +--java.io.Reader
        |
        +--java.io.InputStreamReader
              |
              +--java.io.FileReader
                    |
                    +--de.tuberlin.cs.cis.ocl.util.FileReaderExtension

public class FileReaderExtension
extends java.io.FileReader

The file reader extension extends a file reader by reading whole files in one turn.

Author:
fchabar

Constructor Summary
FileReaderExtension(java.io.File file)
          Constructs a FileReaderExtension passing the file to its supertype.
FileReaderExtension(java.io.FileDescriptor fileDesr)
          Constructs a FileReaderExtension passing the file descriptor to its supertype.
FileReaderExtension(java.lang.String fileName)
          Constructs a FileReaderExtension passing the file name to its supertype.
 
Method Summary
 java.lang.String readFile()
          Reads the content of a whole file.
 
Methods inherited from class java.io.InputStreamReader
close, getEncoding, read, read, ready
 
Methods inherited from class java.io.Reader
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileReaderExtension

public FileReaderExtension(java.lang.String fileName)
                    throws java.io.FileNotFoundException
Constructs a FileReaderExtension passing the file name to its supertype.


FileReaderExtension

public FileReaderExtension(java.io.File file)
                    throws java.io.FileNotFoundException
Constructs a FileReaderExtension passing the file to its supertype.


FileReaderExtension

public FileReaderExtension(java.io.FileDescriptor fileDesr)
Constructs a FileReaderExtension passing the file descriptor to its supertype.

Method Detail

readFile

public java.lang.String readFile()
                          throws java.io.IOException
Reads the content of a whole file.

Returns:
the content of the file.
Throws:
java.io.IOException - if buffered reading from file throws any exception.