This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I want to get the serialized objects in a file to a vector.( For a library system for an assignment)
But I didn't come across a good way to identify the end of the ObjectInputStream.
What is the condition I must add for the while loop in the following code.
Here is a sample code:
This gives an output like this :
java.io.StreamCorruptedException: invalid type code: AC
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)