I have used android.os.MemoryFile class to serialize and deserialize it's objects. What I have done is, I have created custom class name like MyMemoryFile and extends this with MemoryFile class and implement Serializable interface. I override MemoryFile class functions like ReadBytes/WriteBytes. Then I converted all objects into byte array and store in byte ArrayList. Then I converted all byte ArrayList items into String to store in Mysql database and vise versa . I have done this but when I deserialize objects it causes an exception
java.io.InvalidClassException: android.os.MemoryFile; IllegalAccessException
Unfortunately, the in.readObject() throws an InvalidClassException with the message above.
Does anyone know what is causing this and how to fix it?