I'm trying to add all objects within a file to an ArrayList using an ObjectInputStream and Iterator. This is being used to deserialize all objects in a file at once into an arraylist and then add the contents of an arraylist to a tree. No matter what I try I keep getting TypeCast exceptions, StreamCorrupt exceptions, and endless while loops.

I'm having no issues actually deserializing anything and adding it to the tree. Just trying to repeat the process if the branch contains > 1 element.

writeObject is invoked upon instantiation of any object. The object calls the save_object method

Java Code:
//this method works properly. I have checked the text files and all objects //are being written
	private static void save_object(Server object, File fileName) throws IOException {
		   ObjectOutputStream objstream = new ObjectOutputStream(new FileOutputStream(fileName,true));
	       System.out.println("Writing "+object.getName()+ " to file: "+fileName);
from here I call the load_object method that tries to deserialize each object and add it to the arraylist.

Java Code:
	public static ArrayList<Server> load_object() throws Exception {
	       ObjectInputStream objstream = new ObjectInputStream(new FileInputStream(NavigationView.serverFile));
	       ArrayList<Server> servers = new ArrayList<Server>();
	       Server server = null;

//java.io.StreamCorruptedException: invalid type code: AC
//	at java.io.ObjectInputStream.readObject0(Unknown Source)
//	at java.io.ObjectInputStream.readObject(Unknown Source)
//	at groups.Server.load_object(Server.java:46)	       
// this occurs at the line after my loop

	       while(objstream.readObject() != null){
	    	   server = (Server)objstream.readObject();
	    	   System.out.println("Adding "+server.getName());
	       return servers;
I know logically what I'm supposed to be doing to get this working but nothing I try works. Can someone tell me what needs to be done to get this working?