Advertisement
Klapek

Untitled

Feb 5th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1.     public void Deserialize()
  2.     {
  3.         try  
  4.         {
  5.             ObjectInputStream inputStreamBanks = new ObjectInputStream(new FileInputStream("banks.bin"));
  6.             for (int i=0; i<main.arr.size(); ++i)
  7.             {
  8.                 Bank b = (Bank)inputStreamBanks.readObject();
  9.                 main.arr.add(b);
  10.             }
  11.             inputStreamBanks.close();
  12.             ObjectInputStream inputStreamAccs = new ObjectInputStream(new FileInputStream("accs.bin"));
  13.             for (int i=0; i<main.kontoarr.size();++i)
  14.             {
  15.                 Konto k = (Konto)inputStreamAccs.readObject();
  16.                 main.kontoarr.add(k);
  17.             }
  18.             inputStreamAccs.close();
  19.         }
  20.         catch (ClassNotFoundException e)
  21.         {
  22.             // TODO Auto-generated catch block
  23.             e.printStackTrace();
  24.         }
  25.         catch (FileNotFoundException e)
  26.         {
  27.             System.out.println("dupadupadupa");
  28.             // TODO Auto-generated catch block
  29.             e.printStackTrace();
  30.         }
  31.         catch (IOException e)
  32.         {
  33.             // TODO Auto-generated catch block
  34.             e.printStackTrace();
  35.         }
  36.  
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement