I realize that this is a newbie question but maybe someone will be able to
tell me what am I doing wrong.
createFile() gets called each time I have the user generate some numbers
which then get added to the binlist ArrayList.
I'm able to serialize and deserialize the Arraylist. However, when I
deserialize the ArrayList, it will only show the first set of ints. I
looked at the bin file and it does get appended to each time. Any help will
be appreciated.
Rich
private void createFile()
{
foreach (int a in num)
{
binlist.Add (a);
}
Stream streamAppend = File.Open("Numbers.bin",FileMode.Append);
bf.Serialize (streamAppend,binlist);
streamAppend.Close ();
Stream streamRead = File.OpenRead("Numbers.bin");
binlist=(ArrayList)bf.Deserialize (streamRead);
streamRead.Close ();
MessageBox.Show (binlist.Count .ToString ());
for(int i = 0; i < binlist.Count ; i ++)
{
MessageBox.Show (binlist[i].ToString ());
}