Home Tutorialhelp Comment What EOFException all about?

 
 

Comment

Chimwemwe N.
What EOFException all about?,
October 5, 2008 at 5:10 AM

I have tried using the folloing code in my code to read a serialized file and an EOFException keeps being thrown all the time and interruots the running of the program and the compiler keeps highlighting the following line: System.out.println("The text : "+ obj.readObject());
...What is the EOFException?




BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter File name : ");

String file = in.readLine();

System.out.print("Enter extention : ");

String ext = in.readLine();

String filename = file + "." + ext;

File f = new File(filename);

try{

ObjectInputStream obj = new ObjectInputStream(new FileInputStream(f));
System.out.println("The text : "+ obj.readObject());
obj.close();
System.out.println("Deserializing Operation Completly Successfully.");

}

catch(ClassNotFoundException e){

System.out.println(e.getMessage());

}

catch(FileNotFoundException fe){

System.out.println("File not found ");

}


View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

Import java IO - Java Beginners
 

Java Beginners

java io - Java Beginners
 

Java Beginners

java binary file io example
 

Java Interview Questions

Java IO
 

Java Beginners

io
 

Java Beginners

io
 

Java Beginners

IO in java
 

Programming Tutorials

Working With File,Java Input,Java Input Output,Java Inputstream,Java io Tutorial,Java io package,Java io example
 

Java Beginners

java io
 

Java Beginners

Simple IO Application - Java Beginners
 

Java Beginners

java IO
 

Java Beginners

java io
 

Java-Tutorials

Java IO Path
 

Java Beginners

io packages - Java Beginners
 

Java-Tutorials

Java IO InputStream Example
 

Java Beginners

java IO programing
 

Java Beginners

IO concept
 

Java-Tutorials

Java IO Writer
 

Java Beginners

Difference between Java IO Class - Java Beginners
 

Java-Tutorials

Java IO SequenceInputStream Example
 

Java Beginners

java-io - Java Beginners
 

Java Beginners

IO File - Java Beginners
 

General

Site Map - All java tutorials
 

Java Beginners

What is the base class of all classes?
 

Java-Tutorials

Java FileOutputStream Example
 

Java Beginners

Java replace all non alphanumeric
 

Java Beginners

io - Java Beginners
 

Java Beginners

what is the example of wifi in java
 

Java-Tutorials

Java IO OutputStreamWriter
 

Java-Tutorials

Java IO Reader
 

Java-Tutorials

Java ByteArrayOutputStream Example
 

Java-Tutorials

Java IO PrintWriter
 

Java-Tutorials

Java IO FilterWriter
 

Java Beginners

What is a vector in Java? Explain with example.
 

Java-Tutorials

What is Java Platform
 

Java-Tutorials

Java IO OutputStream
 

Java Interview Questions

what is meant by persistence in java???? give a programming example
 

Java Beginners

what is a indentifier - Java Beginners
 

Java-Tutorials

Java IO StringReader
 

Java-Tutorials

Java IO FileReader
 

Java-Tutorials

Java IO CharArrayReader
 

Java-Tutorials

Java IO FilterReader
 

Java-Tutorials

Java IO PipedWriter
 

Java-Tutorials

Java IO StringWriter
 

Java-Tutorials

Java Io BufferedWriter
 

Java-Tutorials

Java IO LineNumberReader
 

Java-Tutorials

Java IO BufferedReader
 

Java-Tutorials

Java IO InputStreamReader
 

Spring Framework

Spring IO Platform 1.0.0 Released
 

Java-Tutorials

Java IO PipedReader
 

Java Beginners

core java ,io operation,calling methods using switch cases
 

Java-Tutorials

Java IO PushbackReader
 

Java-Tutorials

Java IO CharArrayWriter
 

Java Beginners

How to read the data in text file seperated by by ',' in java using IO Operations
 

SQL Question

ALL command - SQL
 

General

Example program to get all the available time zones
 

Java Beginners

What is composition? - Java Beginners
 

Java Beginners

find all unique character in string using java
 

JDBC

JDBC Delete All Rows In Table Example
 

Java Beginners

What is Abstraction - Java Beginners
 

Java Beginners

What is Locale - Java Beginners
 

Java-Tutorials

Java FileInputStream
 

Java-Tutorials

Java String : Replace All
 

JDBC

JDBC Select All Records Example
 

Java-Tutorials

What is Java API?
 

Java Beginners

What is reflection? - Java Beginners
 

Java Beginners

What is singleton? - Java Beginners
 

Java Beginners

What is a transient variable?
 

Java Beginners

hi all - Java Beginners
 

Java Beginners

Java Print the all components
 

Java Interview Questions

what is diference between the vector and arraylist with realtime example - Java Interview Questions
 

Java-Tutorials

Read Text from Standard IO
 

Ajax Questions

What is Java?
 

Java Beginners

java - Java Beginners
 

General Information

What is AWT in java
 

Java Interview Questions

Java
 

Servlets

Deleting All Rows From the database Table
 

Java Beginners

Reversing all root-to-leaf paths in a tree (JAVA) - Java Beginners
 

JDBC Questions

What is JDBC?
 

Java Beginners

core java - Java Beginners
 

Hibernate Interview Questions

What is the main feature of Hibernate3?
 

Java Interview Questions

What is difference between the java and javascript?
 

Core Java

Example of HashSet class in java
 

Java Beginners

What is command line argument in Java
 

Java Technology Tutorials

Java Example Codes and Tutorials
 

Applet Questions

what is web .config method
 

Java Interview Questions

java - Java Interview Questions
 

PHP Tutorial

php list all server variables
 

Java Interview Questions

Java - Java Interview Questions
 

Java-Tutorials

Command Line Standard Output In Java
 

Java-Tutorials

Command Line Standard Error In Java
 

Java Beginners

What are the methods in Object? - Java Beginners
 

Programming Tutorials

ajax example
 

General

Get All Keys and Values of the Properties files in Java
 

Struts Questions

what are Struts ?
 

Java-Tutorials

Get All Keys and Values of the Properties files in Java
 

Java Beginners

Java FTP Example
 

Java-Tutorials

What Is Thread In Java?
 

Java Technology Tutorials

Introduction to Java
 

Java Beginners

size of all primitive data
 

Advertisements Advertisements
 

 

 

DMCA.com