Today I came across strange behavior in Java serialization and deserialization ("weird" because I don't understand)
I serialized and deserialized the object from the linux shared directory. When serializing, everything worked without any problems, but when I tried to deserialize the same file, it throws java. io. EOFException java. io. EOFException java. io. EOFException . In addition, deserialization was unsuccessful only for this newly created file and worked for all other old files in this directory.
So, I searched the Internet and found one thread that said that this was also due to lack of disk space.
So, I cleared some temporary files and voila. I donβt understand how small disk space can only affect deserialization, not serialization?
I am using the apache commons SerializationUtils class. Below is the code for serializing and deserializing
SerializationUtils. serialize(myObject, new FileOutputStream(new File(sharePath+FILEName) ; MyObject object=SerializationUtils. deserialize( new FileInputStream(new File(sharePath+FILEName);
It would be very helpful if someone could explain this behavior. I suspect that his error in SerializationUtils may be throwing an IOException.
thanks
source share