From 0aa191eeef649054971b4eb324e0730672e7cd91 Mon Sep 17 00:00:00 2001 From: Marc Ziegler <2121847@stud.hs-mannheim.de> Date: Tue, 8 Nov 2022 10:13:09 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9EBank-Beispiel/src/de/hs=5Fmannheim/inf?= =?UTF-8?q?ormatik/bank/infrastructure/Persistenz.java=E2=80=9C=20l=C3=B6s?= =?UTF-8?q?chen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bank/infrastructure/Persistenz.java | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 Bank-Beispiel/src/de/hs_mannheim/informatik/bank/infrastructure/Persistenz.java diff --git a/Bank-Beispiel/src/de/hs_mannheim/informatik/bank/infrastructure/Persistenz.java b/Bank-Beispiel/src/de/hs_mannheim/informatik/bank/infrastructure/Persistenz.java deleted file mode 100644 index 5d08e48..0000000 --- a/Bank-Beispiel/src/de/hs_mannheim/informatik/bank/infrastructure/Persistenz.java +++ /dev/null @@ -1,30 +0,0 @@ -package de.hs_mannheim.informatik.bank.infrastructure; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; - -public class Persistenz { - private static final String BANK_DATEI = "-bank-data.ser"; - - public static boolean sindDatenGespeichert(String name) { - return new File(name + BANK_DATEI).exists(); - } - - public static void speichereBankDaten(Object bank, String name) throws Exception { - ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(name + BANK_DATEI)); - oos.writeObject(bank); - oos.close(); - } - - public static Object ladeBankDaten(String name) throws Exception { - ObjectInputStream ois = new ObjectInputStream(new FileInputStream(name + BANK_DATEI)); - Object bank = ois.readObject(); - ois.close(); - - return bank; - } - -}