EOFExceptionNameEOFExceptionSynopsis
DescriptionAn EOFException is thrown in response to an attempt to read past the end of a file. Many file-handling routines indicate the end of a file with a special return code. For example, many read() methods return -1 to indicate that the end of file has been reached. However, in some cases, the program clearly expects a certain format of data in a file. If it's not all there, throwing an exception is an appropriate way to flag the unusual condition of the file. So, for example, a DataInputStream throws an EOFException if it comes to the end of file in the middle of readFloat(). In the java.io package, EOFException is used in the classes that implement the DataInput and ObjectInput interfaces, namely DataInputStream, ObjectInputStream, and RandomAccessFile. Class Summary
public class java.io.EOFException extends java.io.IOException { // Constructors public EOFException(); public EOFException(String s); } ConstructorsEOFExceptionpublic EOFException()
public EOFException(String s)
Inherited Methods
See AlsoDataInput, DataInputStream, Exception, IOException, ObjectInput, ObjectInputStream, RandomAccessFile, Throwable |
|