April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
ObjectInput / ObjectOutput
nExemplo: Salvando data em arquivo
n FileOutputStream out= new FileOutputStream("theTime");
n ObjectOutputStream s = new ObjectOutputStream(out);
n s.writeObject("Today"); s.writeObject(new Date()); s.flush(); out.close();
nExemplo: Recuperando data do arquivo
n FileInputStream in = new FileInputStream("theTime");
n ObjectInputStream s = new ObjectInputStream(in);
n String today=(String)s.readObject(); Date date=(Date)s.readObject();in.close();