public class FileInput
extends java.lang.Object
Be aware that this class will return a value when it encounters EOF. For example, if you call readDouble() and there is no more data, the method returns 0.0. Further calls will result in a LoggedException being thrown. This is a potential source of bugs because the file could be one line shorter than expected and you'd never know.
Constructor and Description |
---|
FileInput(java.lang.String fname)
Construct FileInput object given a file name.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the file when finished
|
boolean |
eof()
Return true if the end of file has been reached.
|
char |
readCharacter()
Read a char value from file.
|
double |
readDouble()
Read a double value from file.
|
float |
readFloat()
Read a float value from file.
|
int |
readInteger()
Read an int value from file.
|
long |
readLong()
Read a long value from file.
|
java.lang.String |
readString()
Read an String value from file.
|
public FileInput(java.lang.String fname)
public void close()
public boolean eof()
public final int readInteger()
public final long readLong()
public final double readDouble()
public final float readFloat()
public final char readCharacter()
public final java.lang.String readString()