readObject « serialize « Java I/O Q&A





1. Java serialization: readObject() vs. readResolve()    stackoverflow.com

The book Effective Java and other sources provide a pretty good explanation on how and when to use the readObject() method when working with serializable Java classes. The readResolve() method, on ...

2. readObject() vs. readResolve() to restore transient fields    stackoverflow.com

According to Serializable javadoc, readResolve() is intended for replacing an object read from the stream. But surely (?) you don't have to replace the object, so is it OK ...

3. Java Mysterious EOF exception with readObject    stackoverflow.com

public static Info readInfoDataFromFile(Context context) {
        Info InfoData = null;
        FileInputStream fis = null;
    ...

4. FindBugs wants readObject(...) to be private for serialization, why?    stackoverflow.com

I am running findbugs on some code and it says the readObject(...) method must be private to be invoked for serialization/unserialization? Why? What is the problem if it is made public? ...

5. Reading serialized objects from a file; readObject doesn't throw EOFException!    coderanch.com

Hello. I've seen this topic many times before here, and I still have not found a solid answer to the problem: When you have a file that you've written many serialized objects to, and then you read in the objects, how do you know when you've read in all of the objects? (Say you don't know exactly how many objects there ...