Android read/write a few string
<p>i want to read/write a few string into android file</p>

<p>So i write information from tree EditTexts</p>

<pre><code>public void save(Person p) {

    try {
        FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
        fos.write(p.getName().getBytes());
        fos.write(p.getSurname().getBytes());
        fos.write(p.getAge().getBytes());
        fos.close();
        Toast toast = Toast.makeText(getApplicationContext(), 
                    "Info was saved!", Toast.LENGTH_SHORT); 
        toast.show();
    } catch (FileNotFoundException e){
        e.printStackTrace();
        Toast toast = Toast.makeText(getApplicationContext(), 
                "File not found exeption!", Toast.LENGTH_SHORT); 
        toast.show();
    } catch (IOException e) {
        e.printStackTrace();
        Toast toast = Toast.makeText(getApplicationContext(), 
                    "Input/Output Exeption!", Toast.LENGTH_SHORT); 
        toast.show();
    }
}
</code></pre>

<p>I try to load back information with method</p>

<pre><code>private void load(){
    String value = "";
    FileInputStream fis;

    try {
        fis = openFileInput(FILENAME);
        byte[] input = new byte[fis.available()];
        while(fis.read(input) != -1 ) {
            value += new String(input);
        }
        edName.setText(value);
        while(fis.read(input) != -1 ) {
            value += new String(input);
        }
        edSurname.setText(value);
        while(fis.read(input) != -1 ) {
            value += new String(input);
        }
        edAge.setText(value);
        fis.close();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
        Toast toast = Toast.makeText(getApplicationContext(), 
                "Input/Output Exeption!", Toast.LENGTH_SHORT); 
        toast.show();
    }

}
</code></pre>

<p>It loads information, but all data are combineted in one row. How can i read some data row for row?</p>

<p>Or can i write/read some class with its fields?( In my example there is class Person with fields Name, Surname, Age, Male)</p>
