Hello All,
I have a serializable class.I read the details of the class and serialize it
to a file...
Now when I want to retrieve them using this code, I get a
StreamCorruptedException.
What I have done is going thr' a loop to retrieve the details but all I can
get is the first set of details followed by an exception.
Note: the class has been serialized to X.txt file.
How can we achieve this....
========================================================================
//code....
FileInputStream fis=new FileInputStream("X.txt");
ObjectInputStream input = new ObjectInputStream(fis);
A obj;
while(true){
obj= (A)input.readObject();
if(obj == null) {
fis.close();
break;
}
out.println(obj.name);
out.println(obj.address);
out.println(obj.phone);
}
Regards,
Ravindra Kakani
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html