I am trying to do some kind of serialization where I can directly read and write objects from file.
To start of I just tried to write a character to file and tried to read it. This keeps giving me EOF exception always. 
I am trying it on a Android device. Here is my code:
public class TestAppActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    try {
        WriteToFile();
        Load();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
public void Load () throws IOException
{
    InputStream fis;
    ObjectInputStream in = null;
    try {
        fis = new FileInputStream(Environment.getExternalStorageDirectory() + "\\test2.ser");
        in = new ObjectInputStream(fis);
        char temp = in.readChar();
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        in.close();
    } 
}
public static void WriteToFile() throws Exception {
    try {
        OutputStream file = new FileOutputStream(Environment.getExternalStorageDirectory() + "\\test2.ser");
        ObjectOutput output = new ObjectOutputStream(file);
        try {
            output.writeChar('c');
        } finally {
            output.close();
        }
    } catch (IOException ex) {
            throw ex;
    }catch (Exception ex) {
        throw ex;
}
}
 }
 
     
     
    