I created a custom object of type Task and I want to save it in a binary file in internal storage. Here is the class I created:
From what I see, you are trying to dump the contents of the object into a file and then read it back. But the way you are doing it now is just writing all the data to the file without any structure, which is a terrible idea.
I would recommend you try to implement the Serializable interface and then just use the writeObject() and readObject() methods.
Alternatively, you could dump the data into an XML file or something that has some structure to it.