Java FileReader Methods
FileReader Methods
The FileReader class reads characters from a file (text I/O):
| Method | Description | Return Type |
|---|---|---|
| read() | Reads one character, or characters into an array (returns -1 at the end of the file) | int |
| ready() | Returns true if the stream is ready to be read | boolean |
| skip() | Skips over n characters | long |
| close() | Closes the stream and releases system resources | void |
| mark() | Marks the current position in the stream | void |
| reset() | Resets the stream to the most recent mark | void |
| markSupported() | Returns true if mark/reset are supported (often false for FileReader) | boolean |
| getEncoding() | Returns the name of the character encoding (may be null if unknown) | String |
| transferTo() | Reads all characters and writes them to the given writer | long |