org.jscience.io
Class TextReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.InputStreamReader
          extended by org.jscience.io.TextReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public final class TextReader
extends java.io.InputStreamReader

Text reader, reads data text files/streams. This class uses buffered I/O.


Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
TextReader(java.io.File file)
          Reads a text file with the specified File object.
TextReader(java.io.InputStream stream)
          Reads text data from an input stream.
TextReader(java.lang.String name)
          Reads a text file with the specified system dependent file name.
 
Method Summary
 int read()
          Read a single character.
 double[][] readArray()
          Reads data to an array.
 
Methods inherited from class java.io.InputStreamReader
close, getEncoding, read, ready
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextReader

public TextReader(java.io.InputStream stream)
Reads text data from an input stream.

Parameters:
stream - DOCUMENT ME!

TextReader

public TextReader(java.lang.String name)
           throws java.io.FileNotFoundException
Reads a text file with the specified system dependent file name.

Parameters:
name - the system dependent file name.
Throws:
java.io.FileNotFoundException - If the file is not found.

TextReader

public TextReader(java.io.File file)
           throws java.io.FileNotFoundException
Reads a text file with the specified File object.

Parameters:
file - the file to be opened for reading.
Throws:
java.io.FileNotFoundException - If the file is not found.
Method Detail

read

public int read()
         throws java.io.IOException
Read a single character.

Overrides:
read in class java.io.InputStreamReader
Returns:
DOCUMENT ME!
Throws:
java.io.IOException - If an I/O error occurs.

readArray

public double[][] readArray()
                     throws java.io.IOException
Reads data to an array.

Returns:
DOCUMENT ME!
Throws:
java.io.IOException - If an I/O error occurs.