Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IO Problem

Status
Not open for further replies.

amarg

Programmer
Nov 19, 2002
106
IN
Hi,

I have the the following code

try {
FileInputStream fis = new FileInputStream("C:\\temp\\charge.ext");
ObjectInputStream ois = new ObjectInputStream(fis);
}
catch(FileNotFoundException e) {
e.printStackTrace();
}
catch(IOException e) {
e.printStackTrace();
}


this code is giving me the error

java.io.StreamCorruptedException: invalid stream header
at java.io_ObjectInputStream.readStreamHeader(Unknown Source)
at java.io_ObjectInputStream.<init>(Unknown Source)
at extract.Main.main(Main.java:19)

what does it mean, and what wrong I am going.

Amar
 

Please give me somemore details.
 
ObjectInputStream is used for reading previously serialized classes from an input stream. Your file C:\\temp\\charge.ext is not a valid serialized object.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top