Java ObjectInputStream - EOFException?

Up vote 0 down vote favorite share g+ share fb share tw.

I was working with ObjectInputStream and was trying to load a HashMap that I had stored in the file. But I am getting EOF Exception java.io. EOFException This is my code .... ObjectInputStream inputStream = null; inputStream = new ObjectInputStream(new FileInputStream("C:\\Users\\User1\\workspace\\Resource\\text.

Txt")); HashMap MapObj = (HashMap) inputStream.readObject(); Can someone please tell me what I am doing wrong? Also when I try to print - System.out. Println("Contents: "+ObjectSteam.toString()); I get null.

I am not sure why the program is not reading the file. Thank You, java object link|improve this question asked 23 mins agoFox357 44% accept rate.

Sounds like the file is just invalid... – user1291492 20 mins ago 1 Why is the file called text. Txt if it contains a Java serialization object? – erickson 15 mins ago 1 How did you store the file?

– Eugene Retunsky 15 mins ago.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions


Thank You!
send