JSci.io
Class TextReader

java.lang.Object
  extended byjava.io.Reader
      extended byjava.io.InputStreamReader
          extended byJSci.io.TextReader

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, 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.


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.

Throws:
java.io.IOException - If an I/O error occurs.

readArray

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

Throws:
java.io.IOException - If an I/O error occurs.