Exemplo n.º 1
0
 public void save(OutputStream outputStream) throws Exception {
   PrintWriter pw = new PrintWriter(outputStream);
   for (User us : users) {
     pw.println(us.getFirstName());
     pw.println(us.getLastName());
     pw.println(us.getBirthDate().getTime());
     pw.println(us.isMale());
     pw.println(us.getCountry().toString());
   }
   pw.close();
 }
Exemplo n.º 2
0
 public void save(OutputStream outputStream) throws Exception {
   BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream));
   for (User u : users) {
     bufferedWriter.write(u.getFirstName());
     bufferedWriter.newLine();
     bufferedWriter.write(u.getLastName());
     bufferedWriter.newLine();
     bufferedWriter.write(String.valueOf(u.getBirthDate().getTime()));
     bufferedWriter.newLine();
     bufferedWriter.write(String.valueOf(u.isMale()));
     bufferedWriter.newLine();
     bufferedWriter.write(String.valueOf(u.getCountry()));
     bufferedWriter.newLine();
   }
   bufferedWriter.close();
 }