Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- BufferedReader rd = null;
- PipedInputStream pis = null;
- PipedOutputStream pos = null;
- ObjectInputStream ois = null;
- ObjectOutputStream oos = null;
- try {
- rd = new BufferedReader(new FileReader("countries.csv"));
- Labor_09.readFile(rd);
- pis = new PipedInputStream();
- pos = new PipedOutputStream(pis);
- oos = new ObjectOutputStream(pos);
- ois = new ObjectInputStream(pis);
- oos.writeObject(countries);
- do-> countries_2 = (List<Country>) ois.readObject();
- } catch (FileNotFoundException ex) {
- System.err.println("Datei wurde nicht gefunden!");
- } catch (IOException ex) {
- System.err.println("Allgemeiner Fehler ist aufgetreten!");
- } finally {
- if (rd != null) {
- try {
- rd.close();
- } catch (IOException ex) {
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment