Class Overview
FileReader is class for turning a file into a character Stream. Data read
from the source is converted into characters. The encoding is assumed to
8859_1. The FileReader contains a buffer of bytes read from the source and
converts these into characters as needed. The buffer size is 8K.
Summary
| Public Constructors |
|
|
FileReader(File file)
Construct a new FileReader on the given File file.
|
|
|
FileReader(FileDescriptor fd)
Construct a new FileReader on the given FileDescriptor fd.
|
|
|
FileReader(String filename)
Construct a new FileReader on the given file named filename.
|
|
[Expand]
Inherited Methods |
From class java.io.InputStreamReader
|
From class java.io.Reader
|
abstract
void
|
close()
Close this Reader.
|
|
void
|
mark(int readLimit)
Set a Mark position in this Reader.
|
|
boolean
|
markSupported()
Returns a boolean indicating whether or not this Reader supports mark()
and reset().
|
|
abstract
int
|
read(char[] buf, int offset, int count)
Reads at most count characters from this Reader and stores
them at offset in the character array buf.
|
|
int
|
read(CharBuffer target)
Read chars from the Reader and then put them to the target
CharBuffer.
|
|
int
|
read(char[] buf)
Reads characters from this Reader and stores them in the character array
buf starting at offset 0.
|
|
int
|
read()
Reads a single character from this reader and returns the result as an
int.
|
|
boolean
|
ready()
Returns a boolean indicating whether or not this Reader is
ready to be read without blocking.
|
|
void
|
reset()
Reset this Readers position to the last mark() location.
|
|
long
|
skip(long count)
Skips count number of characters in this Reader.
|
|
From class java.lang.Object
|
Object
|
clone()
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
|
|
boolean
|
equals(Object o)
Compares the argument to the receiver, and returns true if they represent
the same object using a class specific comparison.
|
|
void
|
finalize()
Called by the virtual machine when there are no longer any (non-weak)
references to the receiver.
|
|
final
Class<? extends Object>
|
getClass()
Returns the unique instance of java.lang.Class which represents the class
of the receiver.
|
|
int
|
hashCode()
Returns an integer hash code for the receiver.
|
|
final
void
|
notify()
Causes one thread which is wait ing on the receiver to be
made ready to run.
|
|
final
void
|
notifyAll()
Causes all threads which are wait ing on the receiver to
be made ready to run.
|
|
String
|
toString()
Returns a string containing a concise, human-readable description of the
receiver.
|
|
final
void
|
wait(long time, int frac)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait(long time)
Causes the thread which sent this message to be made not ready to run
either pending some change in the receiver (as indicated by
notify or notifyAll) or the expiration of
the timeout.
|
|
final
void
|
wait()
Causes the thread which sent this message to be made not ready to run
pending some change in the receiver (as indicated by notify
or notifyAll).
|
|
From interface java.io.Closeable
|
abstract
void
|
close()
Close the object and release any system resources it holds.
|
|
From interface java.lang.Readable
|
abstract
int
|
read(CharBuffer cb)
Reads the characters into the given CharBuffer.
|
|
Public Constructors
public
FileReader
(File file)
Construct a new FileReader on the given File file. If the
file specified cannot be found, throw a
FileNotFoundException.
Parameters
| file
| a File to be opened for reading characters from. |
Construct a new FileReader on the given FileDescriptor fd.
Since a previously opened FileDescriptor is passed as an argument, no
FileNotFoundException is thrown.
Parameters
| fd
| the previously opened file descriptor.
|
public
FileReader
(String filename)
Construct a new FileReader on the given file named filename.
If the filename specified cannot be found, throw a
FileNotFoundException.
Parameters
| filename
| an absolute or relative path specifying the file to open. |