Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Could someone explain EOFException and FileNotFoundException?

Posted on 2004-04-21
9
Medium Priority
?
363 Views
Last Modified: 2008-03-17
which JAVA library it belongs to? which class are they subclasses of?
0
Comment
Question by:aquemini001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 10885605
package java.io
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 10885613
When ever you try to open a file which does not exists, application throws FileNotFoundException
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 10885668
package java.io is used to handle IO Streams and files.

 When ever you try to open a file which does not exists, application throws FileNotFoundException

While reading the file through IO classes, if the stream pointer excceeds the beyond the length of file,

EOFException will be raised. Generally this exception will be raised when you works with RandomAccessFile
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Accepted Solution

by:
sudhakar_koundinya earned 80 total points
ID: 10885690
EOFException:

Signals that an end of file or end of stream has been reached unexpectedly during input.

This exception is mainly used by data input streams, which generally expect a binary file in a specific format, and for which an end of stream is an unusual condition. Most other input streams return a special value on end of stream.

Note that some input operations react to end-of-file by returning a distinguished value (such as -1) rather than by throwing an exception.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 10885693
The java.io package contains the fundamental classes for performing input and output operations in Java. These I/O classes can be divided into four basic groups:

    * Classes for reading input from a stream.

    * Classes for writing output to a stream.

    * Classes for manipulating files.

    * Classes for serializing objects.

All fundamental I/O in Java is based on streams. A stream represents a flow of data, or a channel of communication. Conceptually, there is a reading process at one end of the stream and a writing process at the other end. Java 1.0 supported only byte streams, which meant that Unicode characters were not always handled correctly. As of Java 1.1, there are classes in java.io for both byte streams and character streams. The character stream classes, which are called readers and writers, handle Unicode characters appropriately.
0
 
LVL 9

Expert Comment

by:mmuruganandam
ID: 10885834
Java has two different packages for IO.

One is java.io and the other is java.nio (from jdk 1.4.*).  

Other part you can follow sudhakar.



Regards,
Muruga
0
 
LVL 15

Expert Comment

by:JakobA
ID: 10886742
the below 'inheritace list' is from the page http://java.sun.com/j2se/1.4.2/docs/api/java/io/EOFException.html
I found it by searching for two words:
      eofException java
on google

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.io.IOException
              extended byjava.io.EOFException
0
 

Author Comment

by:aquemini001
ID: 10893223
Thanks for the assistance. Good answers.
0
 

Author Comment

by:aquemini001
ID: 10973441
So would i be correct in sying that they are members of the "java.lang" library and they are subclasses of the "java.io" class?? I need to know which library they are members of AND which class are they subclasses of. Or am i sayin g the same thing  by asking which library they are a member of and which subclass?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question