oiss = new ObjectInputStream(new BufferedInputStream(new FileInputStream(new File("game.txt")))); Partie pAux = (Partie)oiss.readObject(); oiss.close(); p.setVariable1(pAux.getVariable1()); p.setVariable2(pAux.getVariable2());