I was able to read a file on Linux system using ObjectInputStream() to get objects. However, if I use the same code to read the same file on a Windows system, there is an error message as:

"java.io.StreamCorruptedException: invalid type code: 08"

Part of the code:

try
{
while( (o = p.readObject()) != null) <=======PROBLEM HERE
{
msgV.addElement(o); //use a vector to store all objects
}
}
catch(Exception e){};


I googled and couldn't find any clue for this problem. Can any of you help me?
Thanks.