public void write(File file) { try{ ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file)); //for(Object o : cdWinkel){ // if(out.equals(o) == false){ out.writeObject(cdWinkel); // } // } out.close(); } catch(IOException i){ i.printStackTrace(); } } public void read( File file ) { try{ ObjectInputStream in = new ObjectInputStream(new FileInputStream(file)); //System.out.println(file); //ingelezenCd = (Cd) in.readObject(); if(in != null){ cdWinkel = (ArrayList) in.readObject(); } in.close(); } catch(EOFException eo){ eo.printStackTrace(); } catch(IOException i){ i.printStackTrace(); } catch(ClassNotFoundException c){ c.printStackTrace(); } }